aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorEric Sandeen <sandeen@redhat.com>2007-02-10 04:46:07 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-02-11 13:51:34 -0500
commitea9a05a1330053759c02eb2c60547085140a4cbd (patch)
treef81451db36a53d682ad4a623b7144e27a3e04033 /fs
parentbfb58478fe2f8cbbb776d910ff3549515e3c8f4f (diff)
[PATCH] ext3: refuse ro to rw remount of fs with orphan inodes
In the rare case where we have skipped orphan inode processing due to a readonly block device, and the block device subsequently changes back to read-write, disallow a remount,rw transition of the filesystem when we have an unprocessed orphan inodes as this would corrupt the list. Ideally we should process the orphan inode list during the remount, but that's trickier, and this plugs the hole for now. Signed-off-by: Eric Sandeen <sandeen@redhat.com> Cc: "Stephen C. Tweedie" <sct@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/ext3/super.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/fs/ext3/super.c b/fs/ext3/super.c
index b34886734a44..5eec3eb409a2 100644
--- a/fs/ext3/super.c
+++ b/fs/ext3/super.c
@@ -2344,6 +2344,22 @@ static int ext3_remount (struct super_block * sb, int * flags, char * data)
2344 err = -EROFS; 2344 err = -EROFS;
2345 goto restore_opts; 2345 goto restore_opts;
2346 } 2346 }
2347
2348 /*
2349 * If we have an unprocessed orphan list hanging
2350 * around from a previously readonly bdev mount,
2351 * require a full umount/remount for now.
2352 */
2353 if (es->s_last_orphan) {
2354 printk(KERN_WARNING "EXT3-fs: %s: couldn't "
2355 "remount RDWR because of unprocessed "
2356 "orphan inode list. Please "
2357 "umount/remount instead.\n",
2358 sb->s_id);
2359 err = -EINVAL;
2360 goto restore_opts;
2361 }
2362
2347 /* 2363 /*
2348 * Mounting a RDONLY partition read-write, so reread 2364 * Mounting a RDONLY partition read-write, so reread
2349 * and store the current valid flag. (It may have 2365 * and store the current valid flag. (It may have