Skip to content

Commit

Permalink
vfs: ignore error on forced remount
Browse files Browse the repository at this point in the history
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 <[email protected]>
Tested-by: Toshiyuki Okajima <[email protected]>
Signed-off-by: Christoph Hellwig <[email protected]>
  • Loading branch information
Miklos Szeredi authored and Christoph Hellwig committed Nov 2, 2011
1 parent 1fa1e7f commit 2833eb2
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions fs/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 2833eb2

Please sign in to comment.