From owner-freebsd-current Sat Mar 15 21:59:13 2003 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9B29337B401 for ; Sat, 15 Mar 2003 21:59:10 -0800 (PST) Received: from smtp01.syd.iprimus.net.au (smtp01.syd.iprimus.net.au [210.50.30.70]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5B62B43FB1 for ; Sat, 15 Mar 2003 21:59:09 -0800 (PST) (envelope-from tim@robbins.dropbear.id.au) Received: from dilbert.robbins.dropbear.id.au ([210.50.84.135]) by smtp01.syd.iprimus.net.au with Microsoft SMTPSVC(5.0.2195.5600); Sun, 16 Mar 2003 16:59:06 +1100 Received: from dilbert.robbins.dropbear.id.au (gyv7r7v604h20uma@localhost [127.0.0.1]) by dilbert.robbins.dropbear.id.au (8.12.6/8.12.6) with ESMTP id h2G5x6JK075480; Sun, 16 Mar 2003 16:59:06 +1100 (EST) (envelope-from tim@dilbert.robbins.dropbear.id.au) Received: (from tim@localhost) by dilbert.robbins.dropbear.id.au (8.12.6/8.12.6/Submit) id h2G5ww0t075455; Sun, 16 Mar 2003 16:58:58 +1100 (EST) (envelope-from tim) Date: Sun, 16 Mar 2003 16:58:57 +1100 From: Tim Robbins To: FUJITA Kazutoshi Cc: freebsd-current@FreeBSD.org Subject: Re: UDF: bad file descriptor Message-ID: <20030316165857.A74938@dilbert.robbins.dropbear.id.au> References: <20030315.202727.74753735.fujita@soum.co.jp> <20030316003641.A48585@dilbert.robbins.dropbear.id.au> <20030316.052351.74752614.fujita@soum.co.jp> <20030316.060650.71086272.fujita@soum.co.jp> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20030316.060650.71086272.fujita@soum.co.jp>; from fujita@soum.co.jp on Sun, Mar 16, 2003 at 06:06:50AM +0900 X-OriginalArrivalTime: 16 Mar 2003 05:59:07.0124 (UTC) FILETIME=[27D2F340:01C2EB81] Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Sun, Mar 16, 2003 at 06:06:50AM +0900, FUJITA Kazutoshi wrote: > I could mount DVD-RAM successfully. > (This media was formatted by TOSHIBA HDD&DVD video recorder;-p) > But, some files can't be read. > How can I solve this? [...] > # /bin/ls -l > ls: VR_MOVIE.VRO: Bad file descriptor > total 111 > drw-rw-rw- 1 root wheel 2048 Mar 12 13:33 . > drw-rw-rw- 4 root wheel 2048 Mar 16 18:00 .. > -rw-rw-rw- 1 root wheel 56980 Mar 16 18:01 VR_MANGR.BUP > -rw-rw-rw- 1 root wheel 56980 Mar 16 18:01 VR_MANGR.IFO The most likely explanation I can think of for this problem is that "VR_MOVIE.VRO" is a real-time file: 6.11 Real-Time Files A Real-Time file is a file that requires a minimum data-transfer rate when writing or reading, for example, audio and video data. For these files special read and write commands are needed. For example for CD and DVD devices these special commands can be found in the Mount Fuji 4 specification. A Real-Time file shall be identified by file type 249 in the File Type field of the file's ICB Tag. (from OSTA UDF spec, revision 2.01, March 15, 2000) If the file is a real-time file, then the "bad file descriptor" errors are occuring because FreeBSD's UDF filesystem doesn't supports this type of file. Here's a patch that mimics the logic the Linux UDF code uses to decide which UDF file types map to the UNIX "regular" file type: Index: sys/fs/udf/udf_vfsops.c =================================================================== RCS file: /home/ncvs/src/sys/fs/udf/udf_vfsops.c,v retrieving revision 1.10 diff -u -r1.10 udf_vfsops.c --- sys/fs/udf/udf_vfsops.c 11 Mar 2003 22:15:09 -0000 1.10 +++ sys/fs/udf/udf_vfsops.c 16 Mar 2003 03:01:28 -0000 @@ -618,12 +618,16 @@ switch (unode->fentry->icbtag.file_type) { default: + printf("unrecognised file type %d\n", + (int)unode->fentry->icbtag.file_type); vp->v_type = VBAD; break; case 4: vp->v_type = VDIR; break; + case 0: case 5: + case 249: vp->v_type = VREG; break; case 6: The Linux driver doesn't seem to issue the special read and write commands that the quote from the UDF spec. mentions, so I'm not sure whether it will work. Let me know how it goes. Tim To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message