]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
vfs: ignore error on forced remount
authorMiklos Szeredi <mszeredi@suse.cz>
Fri, 28 Oct 2011 12:13:20 +0000 (14:13 +0200)
committerChristoph Hellwig <hch@serles.lst.de>
Wed, 2 Nov 2011 11:53:42 +0000 (12:53 +0100)
On emergency remount we want to force MS_RDONLY on the super block
even if ->remount_fs() failed for some reason.

Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Tested-by: Toshiyuki Okajima <toshi.okajima@jp.fujitsu.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
fs/super.c

index 32a81f3467e06835abdf8e5a3beb91acc3a2c161..afd0f1ad45e052068499f7cc94699bef6fbc4084 100644 (file)
@@ -727,8 +727,13 @@ int do_remount_sb(struct super_block *sb, int flags, void *data, int force)
 
        if (sb->s_op->remount_fs) {
                retval = sb->s_op->remount_fs(sb, &flags, data);
-               if (retval)
-                       return retval;
+               if (retval) {
+                       if (!force)
+                               return retval;
+                       /* If forced remount, go ahead despite any errors */
+                       WARN(1, "forced remount of a %s fs returned %i\n",
+                            sb->s_type->name, retval);
+               }
        }
        sb->s_flags = (sb->s_flags & ~MS_RMT_MASK) | (flags & MS_RMT_MASK);