From owner-freebsd-current@FreeBSD.ORG Thu Jan 22 07:12:44 2004 Return-Path: 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 2E80316A4CE for ; Thu, 22 Jan 2004 07:12:44 -0800 (PST) Received: from mail.dt.e-technik.uni-dortmund.de (krusty.dt.E-Technik.Uni-Dortmund.DE [129.217.163.1]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5129243D2F for ; Thu, 22 Jan 2004 07:12:37 -0800 (PST) (envelope-from ma@dt.e-technik.uni-dortmund.de) Received: from m2a2.dyndns.org (krusty.dt.e-technik.uni-dortmund.de [129.217.163.1])167371B5EE for ; Thu, 22 Jan 2004 16:12:36 +0100 (CET) Received: by merlin.emma.line.org (Postfix, from userid 500) id E1E9FA55B8; Thu, 22 Jan 2004 16:12:33 +0100 (CET) To: Bruce Evans In-Reply-To: <20040122215703.E8399@gamplex.bde.org> (Bruce Evans's message of "Thu, 22 Jan 2004 23:08:23 +1100 (EST)") References: <20040122215703.E8399@gamplex.bde.org> From: Matthias Andree Date: Thu, 22 Jan 2004 16:12:33 +0100 Message-ID: User-Agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii cc: freebsd-current@freebsd.org cc: Matthias Andree cc: tytso@thunk.org Subject: Re: How to fsck -CURRENT on next reboot [ext2fs] X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jan 2004 15:12:44 -0000 Bruce Evans writes: >> 1. mount_ext2fs an ext2 or ext3 file system for read/write >> 2. change a file (or touch or rm one) >> 3. umount that ext2fs again >> >> 4. See how it complains about giving up on fsync first for the ext2fs, then >> for devfs. > > This hopefully only happens after mount -u to convert from ro to rw. After checking that, indeed, that is the problem. > It happens because GEOM has enforced the open mode on the disk device > for a long time, but ext2fs is still missing the hack to always open > rw in case mount -u is used to convert from ro to rw. This gives lots > of unwriteable buffers whose write is retried endlessly every second > or 2 but never gets as far as the driver, and strange results for > subsequent accesses to the file since the buffers are not invalid. > %%% > Index: ext2_vfsops.c > =================================================================== > RCS file: /home/ncvs/src/sys/gnu/ext2fs/ext2_vfsops.c,v > retrieving revision 1.114 > diff -u -2 -r1.114 ext2_vfsops.c > --- ext2_vfsops.c 5 Nov 2003 11:56:58 -0000 1.114 > +++ ext2_vfsops.c 22 Jan 2004 10:39:38 -0000 *snip* that patch fixes the "cannot umount after upgrading from ro to rw" problem (I also looked at the super block to find out if mount -r would mark the file system unclean, but it does not, so it behaves properly). Thanks for the quick help! As to the other questions you ask, it needs further testing (did you mean to include a 2nd patch BTW?) The remaining user-visible and most annoying problem is that a ro-mounted ext2fs still produces "giving up on buffers" for my ufs file systems at reboot/halt. I still need to manually umount ext2 file systems before shutting down. Oh, and while testing I found that "truss -f fsck /linux" caused to fsck processes to lock up. One in D state, one in DV state (suspended in vfork). >> e2fsprogs (with mke2fs, the ext2fs newfs tool) are available as port >> from http://mandree.home.pages.de/freebsd/e2fsprogs/ while Tytso >> (e2fsprogs maintainer) reviews my changes - feedback on my port is >> appreciated. The e2fsprogs stuff from official ports doesn't work >> because it assumes that block devices are buffered. > > About time this was fixed :-). Yep. BTW, I've updated the port to omit e2fsprogs' "fsck" command, to avoid confusion. Unfortunately, I haven't yet seen feedback from Tytso. He's downloaded my changes according to BK logs, but no new release or merge yet. :-( I'm hesitant to release a "somewhat rogue" snapshot from the development sources as official port. I am wondering how to deal with /etc/fstab. I can of course add a symlink from /sbin/fsck_ext2fs to %D/sbin/e2fsck, so I can type "fsck /linux" and have the file system checked, but this will not work when someone sets the Pass# column in fsck to something non-zero. -- Matthias Andree Encrypt your mail: my GnuPG key ID is 0x052E7D95