From owner-freebsd-fs@FreeBSD.ORG Wed Feb 11 10:36:51 2004 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id AEDE516A4CE for ; Wed, 11 Feb 2004 10:36:51 -0800 (PST) Received: from comp.chem.msu.su (comp.chem.msu.su [158.250.32.97]) by mx1.FreeBSD.org (Postfix) with ESMTP id C7F1A43D1D for ; Wed, 11 Feb 2004 10:36:50 -0800 (PST) (envelope-from yar@comp.chem.msu.su) Received: from comp.chem.msu.su (localhost [127.0.0.1]) by comp.chem.msu.su (8.12.9p2/8.12.9) with ESMTP id i1BIam0V019601; Wed, 11 Feb 2004 21:36:48 +0300 (MSK) (envelope-from yar@comp.chem.msu.su) Received: (from yar@localhost) by comp.chem.msu.su (8.12.9p2/8.12.9/Submit) id i1BIakmT019597; Wed, 11 Feb 2004 21:36:46 +0300 (MSK) (envelope-from yar) Date: Wed, 11 Feb 2004 21:36:45 +0300 From: Yar Tikhiy To: Murata Shuuichirou Message-ID: <20040211183645.GA18497@comp.chem.msu.su> References: <1074080151.733.51.camel@cyclops.thehouse> <87ad41z6ru.fsf@fons-adae.s.notwork.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87ad41z6ru.fsf@fons-adae.s.notwork.org> User-Agent: Mutt/1.5.3i cc: Zack Hobson cc: fs@freebsd.org Subject: Re: updating HFS for 5.2R [patch] X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Feb 2004 18:36:51 -0000 On Tue, Feb 03, 2004 at 03:16:21AM +0900, Murata Shuuichirou wrote: > > > With these changes, the code compiles. I can install and load the > > resulting kernel module, and I can sucessfully use newfs_hfs and > > fsck_hfs, but mount_hfs on the same volume always fails with an > > "Input/output error". > > If you have not gotten good results yet, try attached patch. Of > course, your patch is also needed. > > With this patch, I can mount hfs successfully. Creating and > removing files on the filesystem are also succeeded. Excellent work, gentlemen! While currently I have very little time left for hacking, you helped me to bring the HFS port back into functional state. Thank you! > But, I have not tested this fully and found some problems such as: > > 1. Sometime, hfs partitions become unmountable by FreeBSD > (mount_hfs returns "Invalid argument"), although the > partition can still be mounted by MacOSX. Did you try to fsck_hfs such a broken volume? > 2. After editing files on hfs filesystem with vi(1), umounting > the filesystem causes these errors: > > Feb 2 21:13:11 roma kernel: hfs_fsync: dirty: 0xc2d74000: tag hfs, type VREG, usecount 2, writecount 0, refcount 2, flags (VV_SYSTEM), lock type cnode: EXCL (count 1) by thread 0xc2b42a80 (pid 1068) > Feb 2 21:13:11 roma kernel: tag VT_HFS, cnid 4, on dev 4, 24 lock type cnode: EXCL (count 1) by thread 0xc2b42a80 (pid 1068) > (lots of same errors continue) > > Then system crashed. It's me who introduced this bug. I forgot to unlock a buffer at one place. Please try the patch attached. -- Yar --- hfs_vnops.c 20 Jan 2004 17:48:16 -0000 1.52.2.1 +++ hfs_vnops.c 11 Feb 2004 18:23:34 -0000 @@ -1295,6 +1295,7 @@ hfs_fsync(ap) /* * Flush all dirty buffers associated with a vnode. */ +#ifdef DARWIN loop: s = splbio(); VI_LOCK(vp); @@ -1381,6 +1382,9 @@ loop: } VI_UNLOCK(vp); splx(s); +#else /* !DARWIN */ + vop_stdfsync(ap); +#endif /* DARWIN */ metasync: getmicrotime(&tv); @@ -1449,6 +1453,7 @@ hfs_metasync(struct hfsmount *hfsmp, dad (void) VOP_BWRITE(bp); goto exit; } + BUF_UNLOCK(bp); VI_LOCK(vp); } VI_UNLOCK(vp);