aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4
diff options
context:
space:
mode:
authorEric Sandeen <sandeen@redhat.com>2007-02-10 04:46:08 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-02-11 13:51:34 -0500
commitead6596b9e776ac32d82f7d1931d7638e6d4a7bd (patch)
tree32e518737ab4b656cdf573167a6ac6308c4c3aad /fs/ext4
parentea9a05a1330053759c02eb2c60547085140a4cbd (diff)
[PATCH] ext4: 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/ext4')
-rw-r--r--fs/ext4/super.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 486a641ca71b..463b52b32a0e 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -2419,6 +2419,22 @@ static int ext4_remount (struct super_block * sb, int * flags, char * data)
2419 err = -EROFS; 2419 err = -EROFS;
2420 goto restore_opts; 2420 goto restore_opts;
2421 } 2421 }
2422
2423 /*
2424 * If we have an unprocessed orphan list hanging
2425 * around from a previously readonly bdev mount,
2426 * require a full umount/remount for now.
2427 */
2428 if (es->s_last_orphan) {
2429 printk(KERN_WARNING "EXT4-fs: %s: couldn't "
2430 "remount RDWR because of unprocessed "
2431 "orphan inode list. Please "
2432 "umount/remount instead.\n",
2433 sb->s_id);
2434 err = -EINVAL;
2435 goto restore_opts;
2436 }
2437
2422 /* 2438 /*
2423 * Mounting a RDONLY partition read-write, so reread 2439 * Mounting a RDONLY partition read-write, so reread
2424 * and store the current valid flag. (It may have 2440 * and store the current valid flag. (It may have