After a shutdown exfat_write_inode() and exfat_writepages() drop whatever is still dirty. But exfat_put_super() and a remount to read-only still clear VOLUME_DIRTY through exfat_set_vol_flags() which only leaves the boot sector alone on a read-only superblock. So after a shutdown with EXFAT_GOING_DOWN_NOSYNC the volume ends up marked clean although it may be inconsistent. Leave the boot sector alone after a shutdown too. Fixes: f761fcdd289d ("exfat: Implement sops->shutdown and ioctl") Cc: stable@vger.kernel.org Signed-off-by: Christian Brauner (Amutable) --- fs/exfat/super.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/exfat/super.c b/fs/exfat/super.c index 4943cef977418..eef7c159d32f4 100644 --- a/fs/exfat/super.c +++ b/fs/exfat/super.c @@ -98,8 +98,9 @@ static int exfat_set_vol_flags(struct super_block *sb, unsigned short new_flags) /* skip updating volume dirty flag, * if this volume has been mounted with read-only + * or was shut down (it stays dirty then) */ - if (sb_rdonly(sb)) + if (sb_rdonly(sb) || exfat_forced_shutdown(sb)) return 0; p_boot->vol_flags = cpu_to_le16(new_flags); -- 2.53.0