[PATCH RFC 21/28] gfs2: don't set SB_RDONLY on withdraw

Christian Brauner brauner at kernel.org
Wed Oct 28 09:01:49 PDT 2026


On Fri, Oct 16, 2026 at 02:01:00AM +0200, Andreas Gruenbacher wrote:
> According to commit d564053f0746 ("GFS2: Clean up freeze code"), the
> idea of the freeze sysfs file was to make it behave like the FIFREEZE
> / FITHAW ioctls. This isn't what the code is doing at all.

That's a pre-existing and separate from this series. freeze_store() calls
freeze_super() and thaw_super() directly with FREEZE_HOLDER_USERSPACE and never
goes through gfs2_freeze_super() and gfs2_thaw_super(). So it never takes the
freeze glock. I don't think that's for this series to fix.

> Not sure what should prevent us from fixing withdrawn filesystem
> thawing and the SB_RDONLY issue in separate commits. Both need fixing
> in the end, but that's okay.

I guess.

> So before this patch, 'mount -o remount,rw' of a withdrawn filesystem
> fails with -EIO, and this patch changes it to -EROFS. What's wrong
> with -EIO? Once do_withdraw() doesn't set SB_RDONLY anymore, the
> filesystem will remain read-write mounted; getting an -EROFS error in
> that state seems odd.

You can keep -EIO but I tried to make it somewhat consistent.

> > +       /* A withdrawn filesystem can't take the freeze glock anymore. */
> > +       if (gfs2_withdrawn(sdp)) {
> > +               mutex_unlock(&sdp->sd_freeze_mutex);
> > +               return -EIO;
> > +       }
>
> This is racy; the filesystem can still be withdrawn after this
> gfs2_withdrawn() check. It should make more sense to bail out of the
> for loop in gfs2_freeze_super() on withdrawn filesystems.

Right, good catch.

> I'm not a fan of those fake mount options. It doesn't matter all that
> much for "withdrawn" because remounting will fail anyway, but it's
> still messy.

Sure.



More information about the linux-mtd mailing list