• Andrew Ruder's avatar
    fs/super.c: sync ro remount after blocking writers · 807612db
    Andrew Ruder authored
    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.
    
    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: default avatarRichard Weinberger <richard@nod.at>
    Signed-off-by: default avatarAndrew Ruder <andrew.ruder@elecsyscorp.com>
    Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
    807612db
super.c 34.4 KB