[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-id: <8794863F-ED0D-41B9-831A-3AA473E6BB1C@sun.com>
Date: Tue, 23 Feb 2010 12:56:12 -0700
From: Andreas Dilger <adilger@....com>
To: Andreas Dilger <adilger@....com>
Cc: tytso@....edu, linux-ext4@...r.kernel.org
Subject: Re: [PATCH] always set EXCLUSIVE flag for modifying e2fsck
The checks done by e2fsck for mounted vs. read-only runs is confusing.
On the one hand, if e2fsck is NOT run with the "-n" flag (i.e. it might
modify the filesystem), there is no guarantee that it will open the
filesystem with the EXCLUSIVE flag (i.e. O_EXCL) to prevent the block
device from being used later (i.e. mounted while e2fsck is running).
On the other hand, if e2fsck IS run with "-n" (i.e. read-only),
and the /etc/fstab or /proc/mounts does not report the same block
device to match the mountpoint (which happens for Lustre, and can
also happen if there is an overlay mount) then the e2fsck incorrectly
thinks the filesystem is unmounted, but fails because the EXCLUSIVE
flag is set even though it is running read-only.
Fix this so that "e2fsck -n" never sets EXCLUSIVE, and when run without
"-n" it will always set EXCLUSIVE unless the user answered "yes" to:
/dev/sda1 is mounted.
WARNING!!! Running e2fsck on a mounted filesystem may cause
SEVERE filesystem damage.
Do you really want to continue (y/n)?
Cheers, Andreas
--
Andreas Dilger
Sr. Staff Engineer, Lustre Group
Sun Microsystems of Canada, Inc.
Download attachment "e2fsprogs-e2fsck_exclusive.patch" of type "application/octet-stream" (2089 bytes)
Powered by blists - more mailing lists