Commit:     ea9a05a1330053759c02eb2c60547085140a4cbd
Parent:     bfb58478fe2f8cbbb776d910ff3549515e3c8f4f
Author:     Eric Sandeen <[EMAIL PROTECTED]>
AuthorDate: Sat Feb 10 01:46:07 2007 -0800
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Sun Feb 11 10:51:34 2007 -0800

    [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 
    unprocessed orphan inodes as this would corrupt the list.
    Ideally we should process the orphan inode list during the remount, but 
    trickier, and this plugs the hole for now.
    Signed-off-by: Eric Sandeen <[EMAIL PROTECTED]>
    Cc: "Stephen C. Tweedie" <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
 fs/ext3/super.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/fs/ext3/super.c b/fs/ext3/super.c
index b348867..5eec3eb 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)
                                err = -EROFS;
                                goto restore_opts;
+                       /*
+                        * If we have an unprocessed orphan list hanging
+                        * around from a previously readonly bdev mount,
+                        * require a full umount/remount for now.
+                        */
+                       if (es->s_last_orphan) {
+                               printk(KERN_WARNING "EXT3-fs: %s: couldn't "
+                                      "remount RDWR because of unprocessed "
+                                      "orphan inode list.  Please "
+                                      "umount/remount instead.\n",
+                                      sb->s_id);
+                               err = -EINVAL;
+                               goto restore_opts;
+                       }
                         * Mounting a RDONLY partition read-write, so reread
                         * and store the current valid flag.  (It may have
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at

Reply via email to