Skip to content

btrfs: some fiemap fixes

[email protected] linux-btrfs 4 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest2 patches 1 replyIn review
  2. v32 patches 0 repliesSuperseded
  3. v22 patches 0 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v12 patches0 repliesSuperseded

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2btrfs: fix race between ordered extent completion and fiemapfs/btrfs/extent_io.c+96 -70 replies
2/2btrfs: ensure fiemap doesn't race with writes when FIEMAP_FLAG_SYNC is givenfs/btrfs/extent_io.c fs/btrfs/inode.c+29 -140 replies

Reviews trailers per patch

None of the 2 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchJosef Bacik
SeriesR-b
1/2
2/2

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v4 thread

Cover letter [PATCH v4 0/2] btrfs: some fiemap fixes

From: Filipe Manana <[email protected]>

There's a recent regression with fiemap due to a fix for a deadlock between fiemap and memory mapped writes when the fiemap buffer is memory mapped to the same file range, which leads to a race triggering a warning and making fiemap fail. Plus one more long standing race when using FIEMAP_FLAG_SYNC. Details in the change logs.

V4: Updated patch 1/2, added a lot more comments about that's going on,
how each case is dealt with and why, added a missing handling for a delalloc case that could result in emmiting overlapping ranges.

V3: Deal with the case where offset == cache->offset which is also
possible if we had delalloc in the range of a hole or prealloc extent.

V2: Updated patch 1/2 to deal with the case of a hole/prealloc extent
with multiple delalloc ranges inside it.

Filipe Manana (2):
btrfs: fix race between ordered extent completion and fiemap
btrfs: ensure fiemap doesn't race with writes when FIEMAP_FLAG_SYNC is given

 fs/btrfs/extent_io.c | 124 ++++++++++++++++++++++++++++++++++++-------
 fs/btrfs/inode.c     |  22 +++++++-
 2 files changed, 125 insertions(+), 21 deletions(-)
Signature · 1 line
2.40.1