[PATCH v1 2/2] fuse: use iomap helpers to update folio uptodate state
Joanne Koong <[email protected]> Tue, 23 Jun 2026 13:28:42 -0700
| Newsgroups | dev.linux.lists.fuse-devel,org.kernel.vger.linux-fsdevel |
|---|---|
| Message-ID | <[email protected]> |
When fuse enables large folios, a large folio will be backed by iomap_folio_state that keeps track of uptodate and dirty state in an internal bitmap. Fuse writethrough and notify store paths currently set or clear uptodate state with folio_mark_uptodate() / folio_clear_uptodate(), which touch only the folio-level flag, but on an iomap-backed folio, that leaves the uptodate bitmap out of sync. Use iomap helpers to update folio uptodate state, which will make the corresponding updates to the iomap bitmap as well. Signed-off-by: Joanne Koong <[email protected]> --- fs/fuse/file.c | 6 +++--- fs/fuse/notify.c | 4 +++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/fs/fuse/file.c b/fs/fuse/file.c index e052a0d44dee..12a2aa605f6b 100644 --- a/fs/fuse/file.c +++ b/fs/fuse/file.c @@ -1250,13 +1250,13 @@ static ssize_t fuse_send_write_pages(struct fuse_io_args *ia, struct folio *folio = ap->folios[i]; if (err) { - folio_clear_uptodate(folio); + iomap_folio_clear_uptodate(folio); } else { if (count >= folio_size(folio) - offset) count -= folio_size(folio) - offset; else { if (short_write) - folio_clear_uptodate(folio); + iomap_folio_clear_uptodate(folio); count = 0; } offset = 0; @@ -1335,7 +1335,7 @@ static ssize_t fuse_fill_write_pages(struct fuse_io_args *ia, /* If we copied full folio, mark it uptodate */ if (tmp == folio_size(folio)) - folio_mark_uptodate(folio); + iomap_folio_mark_uptodate(folio); if (folio_test_uptodate(folio)) { folio_unlock(folio); diff --git a/fs/fuse/notify.c b/fs/fuse/notify.c index 29578104ae6c..1ba763705d91 100644 --- a/fs/fuse/notify.c +++ b/fs/fuse/notify.c @@ -2,6 +2,8 @@ #include "dev.h" #include "fuse_i.h" + +#include <linux/iomap.h> #include <linux/pagemap.h> static int fuse_notify_poll(struct fuse_conn *fc, unsigned int size, @@ -192,7 +194,7 @@ static int fuse_notify_store(struct fuse_conn *fc, unsigned int size, if (!folio_test_uptodate(folio) && !err && folio_offset == 0 && (nr_bytes == folio_size(folio) || file_size == end)) { folio_zero_segment(folio, nr_bytes, folio_size(folio)); - folio_mark_uptodate(folio); + iomap_folio_mark_uptodate(folio); } folio_unlock(folio); folio_put(folio); -- 2.52.0