vfs: prevent remount read-only if pending removes

If there are any inodes on the super block that have been unlinked
(i_nlink == 0) but have not yet been deleted then prevent the
remounting the super block read-only.

Reported-by: Toshiyuki Okajima <[email protected]>
Signed-off-by: Miklos Szeredi <[email protected]>
Tested-by: Toshiyuki Okajima <[email protected]>
Signed-off-by: Al Viro <[email protected]>
This commit is contained in:
Miklos Szeredi 2011-11-21 12:11:33 +01:00 • committed by Al Viro
commit 8e8b87964b
4 changed files with 7 additions and 29 deletions

View file

@ -729,10 +729,6 @@ int do_remount_sb(struct super_block *sb, int flags, void *data, int force)
retval = sb_prepare_remount_readonly(sb);
if (retval)
return retval;
retval = -EBUSY;
if (!fs_may_remount_ro(sb))
goto cancel_readonly;
}
}