Skip to content

Fix data corruption when blocksize < pagesize for mmapped data

Jan Kara cluster-devel linux-ext4 linux-fsdevel linux-xfs ocfs2-devel reiserfs-devel 3 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest posting 2/22 patches 0 repliesNew
  2. v2 posting 1/22 patches 2 repliesApplied
  3. v12 patches 4 repliesSuperseded

Changes in v2 from the cover letter

- changed helper function name and moved it to mm/truncate.c - I originally thought we can make the helper function update i_size to simplify the interface but it's actually impossible due to generic_write_end() lock ordering constraints.
- used round_up() instead of ALIGN()
- taught truncate_setsize() to use the helper function

Patches in v2 posting 2/2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2bdi: Fix hung task on syncfs/fs-writeback.c mm/backing-dev.c+8 -50 replies
1/2ext4: Don't check quota format when there are no quota filesfs/ext4/super.c+0 -70 replies
1/2ext4: Fix block zeroing when punching holes in indirect block filesfs/ext4/indirect.c+2 -20 replies
1/2jbd2: Avoid pointless scanning of checkpoint listsfs/jbd2/checkpoint.c+18 -140 replies
1/2printk: Debug patch1kernel/printk/printk.c+3 -10 replies
1/2vfs: Fix data corruption when blocksize < pagesize for mmaped datafs/buffer.c include/linux/mm.h mm/truncate.c+68 -00 replies
2/2bdi: Avoid oops on device removalfs/fs-writeback.c include/linux/backing-dev.h mm/backing-dev.c+23 -70 replies
2/2ext3: Don't check quota format when there are no quota filesfs/ext3/super.c+0 -70 replies
2/2ext4: Fix hole punching for files with indirect blocksfs/ext4/indirect.c+10 -20 replies
2/2ext4: Fix mmap data corruption when blocksize < pagesizefs/ext4/inode.c+5 -10 replies
2/2jbd2: Simplify calling convention around __jbd2_journal_clean_checkpoint_listfs/jbd2/checkpoint.c include/linux/jbd2.h+25 -330 replies
2/2printk: Debug patch 2kernel/printk/printk.c+0 -50 replies

Reviews trailers per patch

All 12 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchTejun HeoMike SnitzerShaohua LiDave JiangDouglas LeederYuanhan LiuJan KaraAndreas Bombe
SeriesA-b R-b T-b T-b A-b R-b T-b
1/2R-b Reported-and-tested-by
1/2R-b Reported-and-tested-by
1/2R-b Reported-and-tested-by
1/2R-b Reported-and-tested-by
1/2R-b Reported-and-tested-by
1/2R-b Reported-and-tested-by
2/2R-b
2/2R-b
2/2R-b
2/2R-b
2/2R-b
2/2R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 8 reviewers.

Read the v2 thread

Cover letter [PATCH 0/2 v2] Fix data corruption when blocksize < pagesize for mmapped data

Hello,

this is a second version of the patches to fix data corruption in mmapped
data when blocksize < pagesize as tested by xfstests generic/030 test. The patchset fixes XFS and ext4. I've checked and btrfs doesn't need fixing because it doesn't support blocksize < pagesize. If that's ever going to change btrfs will likely need a similar treatment. ocfs2, ext2, ext3 are OK since they happily allocate blocks during writeback. For other filesystems like gfs2, ubifs, nilfs, ceph,... I'm not sure whether they support blocksize < pagesize@all. Interesting is also NFS which may care but I don't understand its ->page_mkwrite() handler good enough to judge.

Changes since v1:
- changed helper function name and moved it to mm/truncate.c - I originally thought we can make the helper function update i_size to simplify the interface but it's actually impossible due to generic_write_end() lock ordering constraints.
- used round_up() instead of ALIGN()
- taught truncate_setsize() to use the helper function

Honza