Skip to content

xfs: Fix races between readahead and hole punching

Jan Kara linux-fsdevel linux-mm linux-xfs stable 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest3 patches 15 repliesIn review
  2. v13 patches 9 repliesSuperseded

Changes in v2 from the cover letter

* Added reviewed-by tags
* Fixed indentation in xfs_file_fadvise()
* Improved comment and readibility of xfs_file_fadvise()

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3mm: Handle MADV_WILLNEED through vfs_fadvise()mm/madvise.c+16 -61 reply
2/3fs: Export generic_fadvise()include/linux/fs.h mm/fadvise.c+4 -20 replies
3/3xfs: Fix stale data exposure when readahead races with hole punchfs/xfs/xfs_file.c+26 -08 replies

Reviews trailers per patch

All 3 patches have a Reviewed-by or Acked-by.

PatchBoaz HarroshDarrick J. Wong
1/3R-b R-b
2/3R-b
3/3R-b

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

Read the v2 thread

Cover letter [PATCH 0/3 v2] xfs: Fix races between readahead and hole punching

Hello,

this is a patch series that addresses a possible race between readahead and hole punching Amir has discovered [1]. The first patch makes madvise(2) to handle readahead requests through fadvise infrastructure, the third patch then adds necessary locking to XFS to protect against the race. Note that other filesystems need similar protections but e.g. in case of ext4 it isn't so simple without seriously regressing mixed rw workload performance so I'm pushing just xfs fix at this moment which is simple.

Changes since v1 (posted at [2]):
* Added reviewed-by tags
* Fixed indentation in xfs_file_fadvise()
* Improved comment and readibility of xfs_file_fadvise()

Honza

[1] https://lore.kernel.org/linux-fsdevel/CAOQ4uxjQNmxqmtA_VbYW0Su9rKRk2zobJmahcyeaEVOFKVQ5dw@mail.gmail.com/
[2] https://lore.kernel.org/linux-fsdevel/[email protected]/