Skip to content

fuse: clean up offset and page count calculations

Joanne Koong linux-fsdevel oe-kbuild-all 2 versions – Applied

Status from this message: Applied, thanks.

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest4 patches 10 repliesApplied
  2. v13 patches 13 repliesSuperseded

Changes in v2 from the cover letter

* Replace offset_in_folio() patch with patch that restructures fuse_notify_store() and fuse_retrieve() logic (Jingbo)
* Add outarg validation patch (patch 1)

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/4fuse: validate outarg offset and size in notify store/retrievefs/fuse/dev.c+10 -46 replies
2/4fuse: simplify logic in fuse_notify_store() and fuse_retrieve()fs/fuse/dev.c+17 -252 replies
3/4fuse: use DIV_ROUND_UP() for page count calculationsfs/fuse/dev.c fs/fuse/file.c+2 -20 replies
4/4fuse: use offset_in_page() for page offset calculationsfs/fuse/readdir.c+4 -41 reply

Reviews trailers per patch

3 of 4 patches have a Reviewed-by or Acked-by.

PatchDarrick J. WongHorst BirthelmerJingbo Xu
1/4
2/4R-b R-b
3/4R-b R-b
4/4R-b R-b R-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 3 reviewers.

Read the v2 thread

Cover letter [PATCH v2 0/4] fuse: clean up offset and page count calculations

This patchset aims to simplify the folio parsing logic in fuse_notify_store() and fuse_retrieve() and use standard kernel helper macros for common calculations:
* offset_in_folio() for large folio offset calculations
* DIV_ROUND_UP() for page count calculations
* offset_in_page() for page offset calculations

The 1st patch (outarg offset and size validation) is needed for the 2nd patch (simplify logic in fuse_notify_store()/fuse_retrieve()) in order to use "loff_t pos" for file position tracking.

No functional changes intended.

This patchset is on top of Jingbo's patch in [1].

Thanks,
Joanne

[1] https://lore.kernel.org/linux-fsdevel/[email protected]/

Changelog
---------
v1: https://lore.kernel.org/linux-fsdevel/[email protected]/
v1 -> v2:
* Replace offset_in_folio() patch with patch that restructures fuse_notify_store() and fuse_retrieve() logic (Jingbo)
* Add outarg validation patch (patch 1)

Joanne Koong (4):
fuse: validate outarg offset and size in notify store/retrieve
fuse: simplify logic in fuse_notify_store() and fuse_retrieve()
fuse: use DIV_ROUND_UP() for page count calculations
fuse: use offset_in_page() for page offset calculations

 fs/fuse/dev.c     | 52 +++++++++++++++++++++++------------------------
 fs/fuse/file.c    |  2 +-
 fs/fuse/readdir.c |  8 ++++----
 3 files changed, 30 insertions(+), 32 deletions(-)
Signature · 1 line
2.47.3