Re: [PATCH] exfat: clear the volume dirty flag only when remounting read-only

From: Namjae Jeon

Date: Thu Sep 03 2026 - 19:29:34 EST


> diff --git a/fs/exfat/super.c b/fs/exfat/super.c
> index a9ea36ba2693..268732571837 100644
> --- a/fs/exfat/super.c
> +++ b/fs/exfat/super.c
> @@ -775,9 +775,12 @@ static int exfat_reconfigure(struct fs_context *fc)
> fc->sb_flags |= SB_NODIRATIME;
>
> sync_filesystem(sb);
> - mutex_lock(&sbi->s_lock);
> - exfat_clear_volume_dirty(sb);
> - mutex_unlock(&sbi->s_lock);
> +
> + if ((fc->sb_flags & (SB_FORCE | SB_RDONLY)) == SB_RDONLY) {
Could we also add !sb_rdonly(sb) here?
if ((fc->sb_flags & (SB_FORCE | SB_RDONLY)) == SB_RDONLY &&
!sb_rdonly(sb))
Thanks.


> + mutex_lock(&sbi->s_lock);
> + exfat_clear_volume_dirty(sb);
> + mutex_unlock(&sbi->s_lock);
> + }
>
> if (new_opts->allow_utime == (unsigned short)-1)
> new_opts->allow_utime = ~new_opts->fs_dmask & 0022;
> --
> 2.53.0
>