Skip to content

btrfs: fixes for the new fd-based API

Qu Wenruo linux-btrfs 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2btrfs: fix per-subvolume RO/RW flags with new mount APIfs/btrfs/super.c+5 -190 replies
2/2btrfs: fix mount failure due to remount racesfs/btrfs/super.c+27 -390 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/2] btrfs: fixes for the new fd-based API

There are two critical bugs, all introduced by the same new fd-based mount API migration.

The first one will break the per-subvolume RW/RO mount, if using the new fd-based mount API.
This is caused by the untrue promise that the new API will not set the RO flag for the fsconfig() call (which sets the super flags), but only set RO attribute for the mount point.

Based on the bad promise, we skip the RO->RW reconfiguration for the new API based mount call. But since the new fd-based mount is already rolling out to the end users, and it still sets RO flags for both super and mount point.

So we should still do the same RO->RW reconfiguration, no matter the API.

The second one is a long existing problem related the RO->RW reconfiguration itself, where we retry without any lock, resulting race between reconfiguration and RO/RW mounts.

This will leads to a failure to mount, exposed by SLE-micro bug report.

Those two bugs are all small but critical to the core function of btrfs, thus should be queued for -rc kernels.

Qu Wenruo (2):
btrfs: fix per-subvolume RO/RW flags with new mount API
btrfs: fix mount failure due to remount races

 fs/btrfs/super.c | 88 +++++++++++++++++-------------------------------
 1 file changed, 31 insertions(+), 57 deletions(-)
Signature · 1 line
2.47.0