Re: [PATCH] SMP race in ext2 - metadata corruption.

Andreas Dilger (adilger@turbolinux.com)
Sat, 5 May 2001 21:38:31 -0600 (MDT)


Chris Wedgewood writes:
> As I said, I'm not takling about kernel based fsck, although for
> _VERY_ large filesystems even with journalling I suspect it will be
> required one day (so it can run in the background and do consistency
> checking when the machine is idle).

Actually, I was talking with Ted about this, and we agreed that:
a) kernel-based e2fsck is a pain in the a** (locking issues, etc)
b) you can do an LVM snapshot of your live filesystem and do a read-only
fsck on that to check if the filesystem is still OK. For journaled
filesystems like reiserfs and ext3, they need to use the super method
write_super_lockfs() to block I/O and flush everything to disk at the
time of the snapshot, to ensure that they don't need recovery on a
read-only device. This makes the LVM snapshot equivalent to unmount
the filesystem, copy contents to a new device and remount the filesystem.

While (b) doesn't let you fix a filesystem online, unless there is a kernel
bug or hardware problem, you should not have a problem. If you have either
of those, then fixing the filesystem online is just asking for more problems
in the future.

Cheers, Andreas

-- 
Andreas Dilger  \ "If a man ate a pound of pasta and a pound of antipasto,
                 \  would they cancel out, leaving him still hungry?"
http://www-mddsp.enel.ucalgary.ca/People/adilger/               -- Dogbert
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/