ext2/xip: refuse to change xip flag during remount with busy inodes
[linux-2.6-block.git] / fs / ext2 / super.c
index da8bdeaa2e6d594aec9680bcb2bcd0aca17fdecf..7c6e3606f0ecd0d4c4efc64d262b0184b392deaa 100644 (file)
@@ -1185,9 +1185,12 @@ static int ext2_remount (struct super_block * sb, int * flags, char * data)
        es = sbi->s_es;
        if (((sbi->s_mount_opt & EXT2_MOUNT_XIP) !=
            (old_mount_opt & EXT2_MOUNT_XIP)) &&
-           invalidate_inodes(sb))
-               ext2_warning(sb, __func__, "busy inodes while remounting "\
-                            "xip remain in cache (no functional problem)");
+           invalidate_inodes(sb)) {
+               ext2_warning(sb, __func__, "refusing change of xip flag "
+                            "with busy inodes while remounting");
+               sbi->s_mount_opt &= ~EXT2_MOUNT_XIP;
+               sbi->s_mount_opt |= old_mount_opt & EXT2_MOUNT_XIP;
+       }
        if ((*flags & MS_RDONLY) == (sb->s_flags & MS_RDONLY))
                return 0;
        if (*flags & MS_RDONLY) {