mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
fs/super.c: sync ro remount after blocking writers
Move sync_filesystem() after sb_prepare_remount_readonly(). If writers
sneak in anywhere from sync_filesystem() to sb_prepare_remount_readonly()
it can cause inodes to be dirtied and writeback to occur well after
sys_mount() has completely successfully.
This was spotted by corrupted ubifs filesystems on reboot, but appears
that it can cause issues with any filesystem using writeback.
CRs-Fixed: 627559
Change-Id: Ib417b59d39210aab2de4e5ae48b18129e8bc3e26
Cc: Artem Bityutskiy <dedekind1@gmail.com>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
CC: Richard Weinberger <richard@nod.at>
Co-authored-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Andrew Ruder <andrew.ruder@elecsyscorp.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Git-commit: 807612db2f
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
This commit is contained in:
parent
d1b8a61539
commit
8d7f1b4059
1 changed files with 2 additions and 1 deletions
|
@ -740,7 +740,6 @@ int do_remount_sb2(struct vfsmount *mnt, struct super_block *sb, int flags, void
|
|||
if (flags & MS_RDONLY)
|
||||
acct_auto_close(sb);
|
||||
shrink_dcache_sb(sb);
|
||||
sync_filesystem(sb);
|
||||
|
||||
remount_ro = (flags & MS_RDONLY) && !(sb->s_flags & MS_RDONLY);
|
||||
|
||||
|
@ -756,6 +755,8 @@ int do_remount_sb2(struct vfsmount *mnt, struct super_block *sb, int flags, void
|
|||
}
|
||||
}
|
||||
|
||||
sync_filesystem(sb);
|
||||
|
||||
if (mnt && sb->s_op->remount_fs2) {
|
||||
retval = sb->s_op->remount_fs2(mnt, sb, &flags, data);
|
||||
if (retval) {
|
||||
|
|
Loading…
Reference in a new issue