[PATCH RFC 14/28] ntfs: don't set SB_RDONLY after filesystem errors
Hyunchul Lee
hyc.lee at gmail.com
Sun Oct 18 23:14:46 PDT 2026
Hi Christian,
> diff --git a/fs/ntfs/super.c b/fs/ntfs/super.c
> index 4066bacabe37..12ad2ce938ba 100644
> --- a/fs/ntfs/super.c
> +++ b/fs/ntfs/super.c
> @@ -269,6 +269,8 @@ static int ntfs_reconfigure(struct fs_context *fc)
>
> ntfs_debug("Entering with remount");
>
> + /* Mark the volume dirty first if an error made it read-only. */
> + flush_work(&vol->error_work);
> sync_filesystem(sb);
>
if (sb_rdonly(sb) && !(fc->sb_flags & SB_RDONLY)) {
....
return -EROFS;
Before this patch, SB_RDONLY is set, so remount,rw returned -EROFS. With
this patch, sb_rdonly(sb) is false, so remount,rw skips the check and
return success even though writes are rejected with -EROFS.
I think that the condition should be test NVolErrors(), for example
if ((sb_rdonly(sb) || NVolErrors(vol)) &&
!(fc->sb_flags & SB_RDONLY)) {
--
Thanks,
Hyunchul
More information about the linux-mtd
mailing list