iomap: buffered io changes
Subsystems (8)
v4 cover iomap: buffered io changes
This series is on top of the vfs-6.19.iomap branch (head commit ca3557a68684) in Christian's vfs tree.
Thanks,
Joanne
Changelog
---------
v3: https://lore.kernel.org/linux-fsdevel/[email protected]/
v3 -> v4:
* Add patch 1 for renaming bytes_pending/bytes_accounted
* Fix bug in patch 5 to account for the case where the folio has an ifs but iomap_read_init() was never called.
* Add Darrick's Reviewed-bys
* Rebase
v2: https://lore.kernel.org/linux-fsdevel/[email protected]/
v2 -> v3:
* Fix race when writing back all bytes of a folio (patch 3)
* Rename from bytes_pending to bytes_submitted (patch 3)
* Add more comments about logic (patch 3)
* Change bytes_submitted from unsigned to size_t (patch 3) (Matthew)
v1: https://lore.kernel.org/linux-fsdevel/[email protected]/
v1 -> v2:
* Incorporate Christoph's feedback (drop non-block-aligned writes patch, fix bitmap scanning function comments, use more concise variable name, etc)
* For loff_t patch, fix up .writeback_range() callback for zonefs, gfs2, and block
Joanne Koong (9):
iomap: rename bytes_pending/bytes_accounted to
bytes_submitted/bytes_not_submitted
iomap: account for unaligned end offsets when truncating read range
docs: document iomap writeback's iomap_finish_folio_write()
requirement
iomap: optimize pending async writeback accounting
iomap: simplify ->read_folio_range() error handling for reads
iomap: simplify when reads can be skipped for writes
iomap: use loff_t for file positions and offsets in writeback code
iomap: use find_next_bit() for dirty bitmap scanning
iomap: use find_next_bit() for uptodate bitmap scanning
.../filesystems/iomap/operations.rst | 10 +- block/fops.c | 3 +- fs/fuse/file.c | 18 +- fs/gfs2/bmap.c | 3 +- fs/iomap/buffered-io.c | 307 +++++++++++------- fs/iomap/ioend.c | 2 - fs/xfs/xfs_aops.c | 8 +- fs/zonefs/file.c | 3 +- include/linux/iomap.h | 15 +- 9 files changed, 219 insertions(+), 150 deletions(-)
Signature · 1 line
2.47.3
PATCH v4 1/9 iomap: rename bytes_pending/bytes_accounted to bytes_submitted/bytes_not_submitted
The naming "bytes_pending" and "bytes_accounted" may be confusing and could be better named. Rename this to "bytes_submitted" and "bytes_not_submitted" to make it more clear that these are bytes we passed to the IO helper to read in.
--- fs/iomap/buffered-io.c | 39 ++++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 19 deletions(-)
fs/iomap/buffered-io.c +20 -19
@@ -394,16 +394,16 @@ static void iomap_read_init(struct folio *folio)* Else the IO helper will end the read after all submitted ranges have been * read. */ -static void iomap_read_end (struct folio *folio,size_t bytes_pending) +static void iomap_read_end (struct folio *folio,size_t bytes_submitted) {struct iomap_folio_state *ifs;/* -* If there are no bytes pending, this means we are responsible for +* If there are no bytes submitted, this means we are responsible for * unlocking the folio here, since no IO helper has taken ownership of * it. */ -if (!bytes_pending) { +if (!bytes_submitted) {folio_unlock (folio);return ; }
@@ -416,11 +416,11 @@ static void iomap_read_end(struct folio *folio, size_t bytes_pending)* read_bytes_pending but skipped for IO. * The +1 accounts for the bias we added in iomap_read_init(). */ -size_t bytes_accounted =folio_size (folio) +1 - - bytes_pending; +size_t bytes_not_submitted =folio_size (folio) +1 - + bytes_submitted;spin_lock_irq (&ifs->state_lock); - ifs->read_bytes_pending -= bytes_accounted; + ifs->read_bytes_pending -= bytes_not_submitted;/* * If !ifs->read_bytes_pending, this means all pending reads * by the IO helper have already completed, which means we need
@@ -437,7 +437,7 @@ static void iomap_read_end(struct folio *folio, size_t bytes_pending) }static int iomap_read_folio_iter (struct iomap_iter *iter, -struct iomap_read_folio_ctx *ctx,size_t *bytes_pending) +struct iomap_read_folio_ctx *ctx,size_t *bytes_submitted) {const struct iomap *iomap = &iter->iomap;loff_t pos = iter->pos;
@@ -478,9 +478,9 @@ static int iomap_read_folio_iter(struct iomap_iter *iter,folio_zero_range (folio, poff, plen);iomap_set_range_uptodate (folio, poff, plen); }else { -if (!*bytes_pending) +if (!*bytes_submitted)iomap_read_init (folio); - *bytes_pending += plen; + *bytes_submitted += plen; ret = ctx->ops->read_folio_range (iter, ctx, plen);if (ret)return ret;
@@ -504,39 +504,40 @@ void iomap_read_folio(const struct iomap_ops *ops, .pos = folio_pos(folio), .len = folio_size(folio), }; -size_t bytes_pending =0 ; +size_t bytes_submitted =0 ;int ret;trace_iomap_readpage (iter.inode,1 );while ((ret =iomap_iter (&iter, ops)) >0 ) - iter.status =iomap_read_folio_iter (&iter, ctx, &bytes_pending); + iter.status =iomap_read_folio_iter (&iter, ctx, + &bytes_submitted);if (ctx->ops->submit_read) ctx->ops->submit_read (ctx); -iomap_read_end (folio, bytes_pending); +iomap_read_end (folio, bytes_submitted); }EXPORT_SYMBOL_GPL (iomap_read_folio);static int iomap_readahead_iter (struct iomap_iter *iter, -struct iomap_read_folio_ctx *ctx,size_t *cur_bytes_pending) +struct iomap_read_folio_ctx *ctx,size_t *cur_bytes_submitted) {int ret;while (iomap_length (iter)) {if (ctx->cur_folio &&offset_in_folio (ctx->cur_folio, iter->pos) ==0 ) { -iomap_read_end (ctx->cur_folio, *cur_bytes_pending); +iomap_read_end (ctx->cur_folio, *cur_bytes_submitted); ctx->cur_folio =NULL ; }if (!ctx->cur_folio) { ctx->cur_folio =readahead_folio (ctx->rac);if (WARN_ON_ONCE (!ctx->cur_folio))return -EINVAL ; - *cur_bytes_pending =0 ; + *cur_bytes_submitted =0 ; } - ret =iomap_read_folio_iter (iter, ctx, cur_bytes_pending); + ret =iomap_read_folio_iter (iter, ctx, cur_bytes_submitted);if (ret)return ret; }
@@ -568,19 +569,19 @@ void iomap_readahead(const struct iomap_ops *ops, .pos = readahead_pos(rac), .len = readahead_length(rac), }; -size_t cur_bytes_pending; +size_t cur_bytes_submitted;trace_iomap_readahead (rac->mapping->host,readahead_count (rac));while (iomap_iter (&iter, ops) >0 ) iter.status =iomap_readahead_iter (&iter, ctx, - &cur_bytes_pending); + &cur_bytes_submitted);if (ctx->ops->submit_read) ctx->ops->submit_read (ctx);if (ctx->cur_folio) -iomap_read_end (ctx->cur_folio, cur_bytes_pending); +iomap_read_end (ctx->cur_folio, cur_bytes_submitted); }EXPORT_SYMBOL_GPL (iomap_readahead);
Signature · 1 line
2.47.3
PATCH v4 2/9 iomap: account for unaligned end offsets when truncating read range
In reply to Joanne KoongThe end position to start truncating from may be at an offset into a block, which under the current logic would result in overtruncation.
Adjust the calculation to account for unaligned end offsets.
--- fs/iomap/buffered-io.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-)
fs/iomap/buffered-io.c +20 -2
@@ -218,6 +218,22 @@ static void ifs_free(struct folio *folio)kfree (ifs); } +/* +* Calculate how many bytes to truncate based off the number of blocks to +* truncate and the end position to start truncating from. +*/ +static size_t iomap_bytes_to_truncate (loff_t end_pos,unsigned block_bits, +unsigned blocks_truncated) +{ +unsigned block_size =1 << block_bits; +unsigned block_offset = end_pos & (block_size -1 ); + +if (!block_offset) +return blocks_truncated << block_bits; + +return ((blocks_truncated -1 ) << block_bits) + block_offset; +} +/* * Calculate the range inside the folio that we actually need to read. */
@@ -263,7 +279,8 @@ static void iomap_adjust_read_range(struct inode *inode, struct folio *folio,/* truncate len if we find any trailing uptodate block(s) */ while (++i <= last) {if (ifs_block_is_uptodate (ifs, i)) { - plen -= (last - i +1 ) * block_size; + plen -=iomap_bytes_to_truncate (*pos + plen, + block_bits, last - i +1 ); last = i -1 ;break ; }
@@ -279,7 +296,8 @@ static void iomap_adjust_read_range(struct inode *inode, struct folio *folio,unsigned end =offset_in_folio (folio, isize -1 ) >> block_bits;if (first <= end && last > end) - plen -= (last - end) * block_size; + plen -=iomap_bytes_to_truncate (*pos + plen, block_bits, + last - end); } *offp = poff;
Signature · 1 line
2.47.3
PATCH v4 3/9 docs: document iomap writeback's iomap_finish_folio_write() requirement
In reply to Joanne KoongDocument that iomap_finish_folio_write() must be called after writeback on the range completes.
--- Documentation/filesystems/iomap/operations.rst | 3 +++ include/linux/iomap.h | 4 ++++ 2 files changed, 7 insertions(+)
Documentation/filesystems/iomap/operations.rst +3 -0
@@ -361,6 +361,9 @@ The fields are as follows: delalloc reservations to avoid having delalloc reservations for clean pagecache. This function must be supplied by the filesystem. + If this succeeds, iomap_finish_folio_write() must be called once writeback + completes for the range, regardless of whether the writeback succeeded or + failed. - ``writeback_submit``: Submit the previous built writeback context. Block based file systems should use the iomap_ioend_writeback_submit
include/linux/iomap.h +4 -0
@@ -435,6 +435,10 @@ struct iomap_writeback_ops {* An existing mapping from a previous call to this method can be reused * by the file system if it is still valid. * +* If this succeeds, iomap_finish_folio_write() must be called once +* writeback completes for the range, regardless of whether the +* writeback succeeded or failed. +* * Returns the number of bytes processed or a negative errno. */ ssize_t (*writeback_range)(struct iomap_writepage_ctx *wpc,
Signature · 1 line
2.47.3
PATCH v4 4/9 iomap: optimize pending async writeback accounting
In reply to Joanne KoongPending writebacks must be accounted for to determine when all requests have completed and writeback on the folio should be ended. Currently this is done by atomically incrementing ifs->write_bytes_pending for every range to be written back.
Instead, the number of atomic operations can be minimized by setting ifs->write_bytes_pending to the folio size, internally tracking how many bytes are written back asynchronously, and then after sending off all the requests, decrementing ifs->write_bytes_pending by the number of bytes not written back asynchronously. Now, for N ranges written back, only N + 2 atomic operations are required instead of 2N + 2.
--- fs/fuse/file.c | 4 +-- fs/iomap/buffered-io.c | 58 +++++++++++++++++++++++++----------------- fs/iomap/ioend.c | 2 -- include/linux/iomap.h | 2 -- 4 files changed, 36 insertions(+), 30 deletions(-)
fs/fuse/file.c +2 -2
@@ -1885,7 +1885,8 @@ static void fuse_writepage_finish(struct fuse_writepage_args *wpa)* scope of the fi->lock alleviates xarray lock * contention and noticeably improves performance. */ -iomap_finish_folio_write (inode, ap->folios[i],1 ); +iomap_finish_folio_write (inode, ap->folios[i], + ap->descs[i].length);wake_up (&fi->page_waitq); }
@@ -2221,7 +2222,6 @@ static ssize_t fuse_iomap_writeback_range(struct iomap_writepage_ctx *wpc, ap = &wpa->ia.ap; } -iomap_start_folio_write (inode, folio,1 );fuse_writepage_args_page_fill (wpa, folio, ap->num_folios, offset, len); data->nr_bytes += len;
fs/iomap/buffered-io.c +34 -24
114 lines not on this page · raw message
fs/iomap/ioend.c +0 -2
@@ -194,8 +194,6 @@ ssize_t iomap_add_to_ioend(struct iomap_writepage_ctx *wpc, struct folio *folio,if (!bio_add_folio (&ioend->io_bio, folio, map_len, poff)) goto new_ioend; -iomap_start_folio_write (wpc->inode, folio, map_len); -/* * Clamp io_offset and io_size to the incore EOF so that ondisk * file size updates in the ioend completion are byte-accurate.
include/linux/iomap.h +0 -2
@@ -478,8 +478,6 @@ int iomap_ioend_writeback_submit(struct iomap_writepage_ctx *wpc, int error);void iomap_finish_folio_read (struct folio *folio,size_t off,size_t len,int error); -void iomap_start_folio_write (struct inode *inode,struct folio *folio, -size_t len);void iomap_finish_folio_write (struct inode *inode,struct folio *folio,size_t len);
Signature · 1 line
2.47.3
PATCH v4 5/9 iomap: simplify ->read_folio_range() error handling for reads
In reply to Joanne KoongInstead of requiring that the caller calls iomap_finish_folio_read() even if the ->read_folio_range() callback returns an error, account for this internally in iomap instead, which makes the interface simpler and makes it match writeback's ->read_folio_range() error handling expectations.
--- .../filesystems/iomap/operations.rst | 7 +-- fs/fuse/file.c | 10 +-- fs/iomap/buffered-io.c | 63 ++++++++++--------- include/linux/iomap.h | 5 +- 4 files changed, 41 insertions(+), 44 deletions(-)
Documentation/filesystems/iomap/operations.rst +3 -4
@@ -149,10 +149,9 @@ These ``struct kiocb`` flags are significant for buffered I/O with iomap: iomap calls these functions: - ``read_folio_range``: Called to read in the range. This must be provided - by the caller. The caller is responsible for calling - iomap_finish_folio_read() after reading in the folio range. This should be - done even if an error is encountered during the read. This returns 0 on - success or a negative error on failure. + by the caller. If this succeeds, iomap_finish_folio_read() must be called + after the range is read in, regardless of whether the read succeeded or + failed. - ``submit_read``: Submit any pending read requests. This function is optional.
fs/fuse/file.c +2 -8
@@ -922,13 +922,6 @@ static int fuse_iomap_read_folio_range_async(const struct iomap_iter *iter,if (ctx->rac) { ret =fuse_handle_readahead (folio, ctx->rac, data, pos, len); -/* -* If fuse_handle_readahead was successful, fuse_readpages_end -* will do the iomap_finish_folio_read, else we need to call it -* here -*/ -if (ret) -iomap_finish_folio_read (folio, off, len, ret); }else {/* * for non-readahead read requests, do reads synchronously
@@ -936,7 +929,8 @@ static int fuse_iomap_read_folio_range_async(const struct iomap_iter *iter,* out-of-order reads */ ret =fuse_do_readfolio (file, folio, off, len); -iomap_finish_folio_read (folio, off, len, ret); +if (!ret) +iomap_finish_folio_read (folio, off, len, ret); }return ret; }
fs/iomap/buffered-io.c +34 -29
94 lines not on this page · raw message
include/linux/iomap.h +2 -3
@@ -495,9 +495,8 @@ struct iomap_read_ops {/* * Read in a folio range. * -* The caller is responsible for calling iomap_finish_folio_read() after -* reading in the folio range. This should be done even if an error is -* encountered during the read. +* If this succeeds, iomap_finish_folio_read() must be called after the +* range is read in, regardless of whether the read succeeded or failed. * * Returns 0 on success or a negative error on failure. */
Signature · 1 line
2.47.3
Re: [PATCH v4 5/9] iomap: simplify ->read_folio_range() error handling for reads
Quoted 5 lines · Joanne Koong
Instead of requiring that the caller calls
iomap_finish_folio_read()even if the ->read_folio_range() callback returns an error, account for this internally in iomap instead, which makes the interface simpler and makes it match writeback's ->read_folio_range() error handling expectations.
Bisection of next-20251117 leads to this patch (commit f8eaf79406fe9415db0e7a5c175b50cb01265199)
Here's the failure:
generic/008 run fstests generic/008 at 2025-11-17 20:40:31
page: refcount:5 mapcount:0 mapping:00000000101f858e index:0x4 pfn:0x12d4f8
head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 memcg:ffff8881120315c0
aops:xfs_address_space_operations ino:83 dentry name(?):"008.2222"
flags: 0x8000000000014069(locked|uptodate|lru|private|head|reclaim|zone=2)
raw: 8000000000014069 ffffea0004b69f48 ffffea0004a0a508 ffff8881139d83f0 raw: 0000000000000004 ffff8881070b4420 00000005ffffffff ffff8881120315c0
head: 8000000000014069 ffffea0004b69f48 ffffea0004a0a508 ffff8881139d83f0
head: 0000000000000004 ffff8881070b4420 00000005ffffffff ffff8881120315c0
head: 8000000000000202 ffffea0004b53e01 00000000ffffffff 00000000ffffffff
head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000004
page dumped because: VM_BUG_ON_FOLIO(success && folio_test_uptodate(folio)) ------------[ cut here ]------------ kernel BUG at mm/filemap.c:1538! Oops: invalid opcode: 0000 [#1] SMP NOPTI CPU: 1 UID: 0 PID: 2607 Comm: xfs_io Not tainted 6.18.0-rc1-ktest-00033-gf8eaf79406fe #151 NONE Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 RIP: 0010:folio_end_read+0x68/0x70 Code: 8e e9 04 00 0f 0b 48 8b 07 48 89 c2 48 c1 ea 03 a8 08 74 00 83 e2 01 b8 09 00 00 00 74 c2 48 c7 c6 a0 6e 3e 82 e8 68 e9 04 00 <0f> 0b 90 0f 1f 44 00 00 90 90 90 90 90 90 90 90 90 90 90 90 90 90 RSP: 0018:ffff888112333870 EFLAGS: 00010286 RAX: 000000000000004b RBX: ffffea0004b53e00 RCX: 0000000000000027 RDX: ffff888179657c08 RSI: 0000000000000001 RDI: ffff888179657c00 RBP: ffff888112333870 R08: 00000000fffbffff R09: ffff88817f1fdfa8 R10: 0000000000000003 R11: 0000000000000000 R12: ffff8881070b4420 R13: 0000000000000001 R14: ffff888112333b28 R15: ffffea0004b53e00 FS: 00007f7b1ad91880(0000) GS:ffff8881f6b0b000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 000055d7455da018 CR3: 00000001111ac000 CR4: 0000000000750eb0 PKRU: 55555554 Call Trace: <TASK> iomap_read_end+0xac/0x130 iomap_readahead+0x1e1/0x330 xfs_vm_readahead+0x3d/0x50 read_pages+0x69/0x270 page_cache_ra_order+0x2c2/0x4d0 page_cache_async_ra+0x204/0x3c0 filemap_readahead.isra.0+0x67/0x80 filemap_get_pages+0x376/0x8a0 ? find_held_lock+0x31/0x90 ? try_charge_memcg+0x21a/0x750 ? lock_acquire+0xb2/0x290 ? __memcg_kmem_charge_page+0x160/0x3c0 filemap_read+0x106/0x4c0 ? __might_fault+0x35/0x80 generic_file_read_iter+0xbc/0x110 xfs_file_buffered_read+0xa9/0x110 xfs_file_read_iter+0x82/0xf0 vfs_read+0x277/0x360 __x64_sys_pread64+0x7a/0xa0 x64_sys_call+0x1b03/0x1da0 do_syscall_64+0x6a/0x2e0 entry_SYSCALL_64_after_hwframe+0x76/0x7e RIP: 0033:0x7f7b1b0efd07 Code: 08 89 3c 24 48 89 4c 24 18 e8 55 76 fa ff 4c 8b 54 24 18 48 8b 54 24 10 41 89 c0 48 8b 74 24 08 8b 3c 24 b8 11 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 31 44 89 c7 48 89 04 24 e8 a5 76 fa ff 48 8b RSP: 002b:00007ffc4a4b8080 EFLAGS: 00000293 ORIG_RAX: 0000000000000011 RAX: ffffffffffffffda RBX: 0000000000001000 RCX: 00007f7b1b0efd07 RDX: 0000000000001000 RSI: 000055d7455d8000 RDI: 0000000000000003 RBP: 0000000000001000 R08: 0000000000000000 R09: 0000000000000003 R10: 0000000000001000 R11: 0000000000000293 R12: 0000000000000001 R13: 0000000000020000 R14: 000000000001f000 R15: 0000000000001000 </TASK> Modules linked in: ---[ end trace 0000000000000000 ]--- RIP: 0010:folio_end_read+0x68/0x70 Code: 8e e9 04 00 0f 0b 48 8b 07 48 89 c2 48 c1 ea 03 a8 08 74 00 83 e2 01 b8 09 00 00 00 74 c2 48 c7 c6 a0 6e 3e 82 e8 68 e9 04 00 <0f> 0b 90 0f 1f 44 00 00 90 90 90 90 90 90 90 90 90 90 90 90 90 90 RSP: 0018:ffff888112333870 EFLAGS: 00010286 RAX: 000000000000004b RBX: ffffea0004b53e00 RCX: 0000000000000027 RDX: ffff888179657c08 RSI: 0000000000000001 RDI: ffff888179657c00 RBP: ffff888112333870 R08: 00000000fffbffff R09: ffff88817f1fdfa8 R10: 0000000000000003 R11: 0000000000000000 R12: ffff8881070b4420 R13: 0000000000000001 R14: ffff888112333b28 R15: ffffea0004b53e00 FS: 00007f7b1ad91880(0000) GS:ffff8881f6b0b000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 000055d7455da018 CR3: 00000001111ac000 CR4: 0000000000750eb0 PKRU: 55555554 Kernel panic - not syncing: Fatal exception Kernel Offset: disabled ---[ end Kernel panic - not syncing: Fatal exception ]---
You're calling folio_end_read(folio, true) for a folio which is already marked uptodate! I haven't looked through your patch to see what the problem is yet. Very reproducible, you only have to run generic/008 with a 1kB blocksize XFS. And CONFIG_VM_DEBUG set, of course.
Re: [PATCH v4 5/9] iomap: simplify ->read_folio_range() error handling for reads
Quoted 94 lines · Matthew Wilcox
Quoted 5 lines · Joanne Koong
Instead of requiring that the caller calls
iomap_finish_folio_read()even if the ->read_folio_range() callback returns an error, account for this internally in iomap instead, which makes the interface simpler and makes it match writeback's ->read_folio_range() error handling expectations.Bisection of next-20251117 leads to this patch (commit
f8eaf79406fe9415db0e7a5c175b50cb01265199)Here's the failure:
generic/008 run fstests generic/008 at 2025-11-17 20:40:31
page: refcount:5 mapcount:0 mapping:00000000101f858e index:0x4 pfn:0x12d4f8head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 memcg:ffff8881120315c0
aops:xfs_address_space_operations ino:83 dentry name(?):"008.2222"
flags: 0x8000000000014069(locked|uptodate|lru|private|head|reclaim|zone=2)raw: 8000000000014069 ffffea0004b69f48 ffffea0004a0a508 ffff8881139d83f0 raw: 0000000000000004 ffff8881070b4420 00000005ffffffff ffff8881120315c0head: 8000000000014069
ffffea0004b69f48ffffea0004a0a508ffff8881139d83f0
head: 0000000000000004ffff8881070b442000000005ffffffffffff8881120315c0
head: 8000000000000202ffffea0004b53e0100000000ffffffff00000000ffffffff
head: ffffffffffffffff 000000000000000000000000ffffffff0000000000000004page dumped because: VM_BUG_ON_FOLIO(success && folio_test_uptodate(folio)) ------------[ cut here ]------------ kernel BUG at mm/filemap.c:1538! Oops: invalid opcode: 0000 [#1] SMP NOPTI CPU: 1 UID: 0 PID: 2607 Comm: xfs_io Not tainted 6.18.0-rc1-ktest-00033-gf8eaf79406fe #151 NONE Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 RIP: 0010:folio_end_read+0x68/0x70 Code: 8e e9 04 00 0f 0b 48 8b 07 48 89 c2 48 c1 ea 03 a8 08 74 00 83 e2 01 b8 09 00 00 00 74 c2 48 c7 c6 a0 6e 3e 82 e8 68 e9 04 00 <0f> 0b 90 0f 1f 44 00 00 90 90 90 90 90 90 90 90 90 90 90 90 90 90 RSP: 0018:ffff888112333870 EFLAGS: 00010286 RAX: 000000000000004b RBX: ffffea0004b53e00 RCX: 0000000000000027 RDX: ffff888179657c08 RSI: 0000000000000001 RDI: ffff888179657c00 RBP: ffff888112333870 R08: 00000000fffbffff R09: ffff88817f1fdfa8 R10: 0000000000000003 R11: 0000000000000000 R12: ffff8881070b4420 R13: 0000000000000001 R14: ffff888112333b28 R15: ffffea0004b53e00 FS: 00007f7b1ad91880(0000) GS:ffff8881f6b0b000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 000055d7455da018 CR3: 00000001111ac000 CR4: 0000000000750eb0 PKRU: 55555554 Call Trace: <TASK> iomap_read_end+0xac/0x130 iomap_readahead+0x1e1/0x330 xfs_vm_readahead+0x3d/0x50 read_pages+0x69/0x270 page_cache_ra_order+0x2c2/0x4d0 page_cache_async_ra+0x204/0x3c0 filemap_readahead.isra.0+0x67/0x80 filemap_get_pages+0x376/0x8a0 ? find_held_lock+0x31/0x90 ? try_charge_memcg+0x21a/0x750 ? lock_acquire+0xb2/0x290 ? __memcg_kmem_charge_page+0x160/0x3c0 filemap_read+0x106/0x4c0 ? __might_fault+0x35/0x80 generic_file_read_iter+0xbc/0x110 xfs_file_buffered_read+0xa9/0x110 xfs_file_read_iter+0x82/0xf0 vfs_read+0x277/0x360 __x64_sys_pread64+0x7a/0xa0 x64_sys_call+0x1b03/0x1da0 do_syscall_64+0x6a/0x2e0 entry_SYSCALL_64_after_hwframe+0x76/0x7e RIP: 0033:0x7f7b1b0efd07 Code: 08 89 3c 24 48 89 4c 24 18 e8 55 76 fa ff 4c 8b 54 24 18 48 8b 54 24 10 41 89 c0 48 8b 74 24 08 8b 3c 24 b8 11 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 31 44 89 c7 48 89 04 24 e8 a5 76 fa ff 48 8b RSP: 002b:00007ffc4a4b8080 EFLAGS: 00000293 ORIG_RAX: 0000000000000011 RAX: ffffffffffffffda RBX: 0000000000001000 RCX: 00007f7b1b0efd07 RDX: 0000000000001000 RSI: 000055d7455d8000 RDI: 0000000000000003 RBP: 0000000000001000 R08: 0000000000000000 R09: 0000000000000003 R10: 0000000000001000 R11: 0000000000000293 R12: 0000000000000001 R13: 0000000000020000 R14: 000000000001f000 R15: 0000000000001000 </TASK> Modules linked in: ---[ end trace 0000000000000000 ]--- RIP: 0010:folio_end_read+0x68/0x70 Code: 8e e9 04 00 0f 0b 48 8b 07 48 89 c2 48 c1 ea 03 a8 08 74 00 83 e2 01 b8 09 00 00 00 74 c2 48 c7 c6 a0 6e 3e 82 e8 68 e9 04 00 <0f> 0b 90 0f 1f 44 00 00 90 90 90 90 90 90 90 90 90 90 90 90 90 90 RSP: 0018:ffff888112333870 EFLAGS: 00010286 RAX: 000000000000004b RBX: ffffea0004b53e00 RCX: 0000000000000027 RDX: ffff888179657c08 RSI: 0000000000000001 RDI: ffff888179657c00 RBP: ffff888112333870 R08: 00000000fffbffff R09: ffff88817f1fdfa8 R10: 0000000000000003 R11: 0000000000000000 R12: ffff8881070b4420 R13: 0000000000000001 R14: ffff888112333b28 R15: ffffea0004b53e00 FS: 00007f7b1ad91880(0000) GS:ffff8881f6b0b000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 000055d7455da018 CR3: 00000001111ac000 CR4: 0000000000750eb0 PKRU: 55555554 Kernel panic - not syncing: Fatal exception Kernel Offset: disabled ---[ end Kernel panic - not syncing: Fatal exception ]---
Quoted 4 lines
You're calling
folio_end_read(folio, true)for a folio which is already marked uptodate! I haven't looked through your patch to see what the problem is yet. Very reproducible, you only have to run generic/008 with a 1kB blocksize XFS. AndCONFIG_VM_DEBUGset, of course.
Ok, I see how we're getting into this state. For the case where all the blocks get zeroed instead of read in, the iomap_set_range_uptodate() call could have also called folio_mark_uptodate() already.
This fixes the issue:
+++ b/fs/iomap/buffered-io.c
@@ -423,7 +423,9 @@ static void iomap_read_end(struct folio *folio, size_t bytes_submitted)
spin_lock_irq(&ifs->state_lock);
if (!ifs->read_bytes_pending) {
WARN_ON_ONCE(bytes_submitted);
- end_read = true;
+ spin_unlock_irq(&ifs->state_lock);
+ folio_unlock(folio);
+ return;
} else {I'll submit this fix to Christian's branch.
Thanks for giving the repro.
PATCH v4 6/9 iomap: simplify when reads can be skipped for writes
In reply to Joanne KoongCurrently, the logic for skipping the read range for a write is
if (!(iter->flags & IOMAP_UNSHARE) &&
(from <= poff || from >= poff + plen) &&
(to <= poff || to >= poff + plen))which breaks down to skipping the read if any of these are true:
a) from <= poff && to <= poff
b) from <= poff && to >= poff + plen
c) from >= poff + plen && to <= poff
d) from >= poff + plen && to >= poff + plen
This can be simplified to
if (!(iter->flags & IOMAP_UNSHARE) && from <= poff && to >= poff + plen)
from the following reasoning:
a) from <= poff && to <= poff
This reduces to 'to <= poff' since it is guaranteed that 'from <= to' (since to = from + len). It is not possible for 'from <= to' to be true here because we only reach here if plen > 0 (thanks to the preceding 'if (plen == 0)' check that would break us out of the loop). If 'to <= poff', plen would have to be 0 since poff and plen get adjusted in lockstep for uptodate blocks. This means we can eliminate this check.
c) from >= poff + plen && to <= poff
This is not possible since 'from <= to' and 'plen > 0'. We can eliminate this check.
d) from >= poff + plen && to >= poff + plen
This reduces to 'from >= poff + plen' since 'from <= to'.
It is not possible for 'from >= poff + plen' to be true here. We only reach here if plen > 0 and for writes, poff and plen will always be block-aligned, which means poff <= from < poff + plen. We can eliminate this check.
The only valid check is b) from <= poff && to >= poff + plen.
--- fs/iomap/buffered-io.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
fs/iomap/buffered-io.c +6 -3
@@ -758,9 +758,12 @@ static int __iomap_write_begin(const struct iomap_iter *iter,if (plen ==0 )break ; -if (!(iter->flags &IOMAP_UNSHARE ) && - (from <= poff || from >= poff + plen) && - (to <= poff || to >= poff + plen)) +/* +* If the read range will be entirely overwritten by the write, +* we can skip having to zero/read it in. +*/ +if (!(iter->flags &IOMAP_UNSHARE ) && from <= poff && + to >= poff + plen)continue ;if (iomap_block_needs_zeroing (iter, block_start)) {
Signature · 1 line
2.47.3
PATCH v4 7/9 iomap: use loff_t for file positions and offsets in writeback code
In reply to Joanne KoongUse loff_t instead of u64 for file positions and offsets to be consistent with kernel VFS conventions. Both are 64-bit types. loff_t is signed for historical reasons but this has no practical effect.
--- block/fops.c | 3 ++- fs/fuse/file.c | 4 ++-- fs/gfs2/bmap.c | 3 ++- fs/iomap/buffered-io.c | 17 +++++++++-------- fs/xfs/xfs_aops.c | 8 ++++---- fs/zonefs/file.c | 3 ++- include/linux/iomap.h | 4 ++-- 7 files changed, 23 insertions(+), 19 deletions(-)
block/fops.c +2 -1
@@ -550,7 +550,8 @@ static void blkdev_readahead(struct readahead_control *rac) }static ssize_t blkdev_writeback_range (struct iomap_writepage_ctx *wpc, -struct folio *folio,u64 offset,unsigned int len,u64 end_pos) +struct folio *folio,loff_t offset,unsigned int len, +loff_t end_pos) {loff_t isize =i_size_read (wpc->inode);
fs/fuse/file.c +2 -2
@@ -2168,8 +2168,8 @@ static bool fuse_folios_need_send(struct fuse_conn *fc, loff_t pos, }static ssize_t fuse_iomap_writeback_range (struct iomap_writepage_ctx *wpc, -struct folio *folio,u64 pos, -unsigned len,u64 end_pos) +struct folio *folio,loff_t pos, +unsigned len,loff_t end_pos) {struct fuse_fill_wb_data *data = wpc->wb_ctx;struct fuse_writepage_args *wpa = data->wpa;
fs/gfs2/bmap.c +2 -1
@@ -2473,7 +2473,8 @@ int __gfs2_punch_hole(struct file *file, loff_t offset, loff_t length) }static ssize_t gfs2_writeback_range (struct iomap_writepage_ctx *wpc, -struct folio *folio,u64 offset,unsigned int len,u64 end_pos) +struct folio *folio,loff_t offset,unsigned int len, +loff_t end_pos) {if (WARN_ON_ONCE (gfs2_is_stuffed (GFS2_I (wpc->inode))))return -EIO ;
fs/iomap/buffered-io.c +9 -8
@@ -86,7 +86,8 @@ static inline bool ifs_block_is_dirty(struct folio *folio, }static unsigned ifs_find_dirty_range (struct folio *folio, -struct iomap_folio_state *ifs,u64 *range_start,u64 range_end) +struct iomap_folio_state *ifs,loff_t *range_start, +loff_t range_end) {struct inode *inode = folio->mapping->host; unsigned start_blk =
@@ -110,8 +111,8 @@ static unsigned ifs_find_dirty_range(struct folio *folio,return nblks << inode->i_blkbits; } -static unsigned iomap_find_dirty_range (struct folio *folio,u64 *range_start, -u64 range_end) +static unsigned iomap_find_dirty_range (struct folio *folio,loff_t *range_start, +loff_t range_end) {struct iomap_folio_state *ifs = folio->private;
@@ -1683,7 +1684,7 @@ void iomap_finish_folio_write(struct inode *inode, struct folio *folio,EXPORT_SYMBOL_GPL (iomap_finish_folio_write);static int iomap_writeback_range (struct iomap_writepage_ctx *wpc, -struct folio *folio,u64 pos,u32 rlen,u64 end_pos, +struct folio *folio,loff_t pos,u32 rlen,loff_t end_pos,size_t *bytes_submitted) { do {
@@ -1715,7 +1716,7 @@ static int iomap_writeback_range(struct iomap_writepage_ctx *wpc,* i_size, adjust end_pos and zero all data beyond i_size. */ static bool iomap_writeback_handle_eof (struct folio *folio,struct inode *inode, -u64 *end_pos) +loff_t *end_pos) {u64 isize =i_size_read (inode);
@@ -1770,9 +1771,9 @@ int iomap_writeback_folio(struct iomap_writepage_ctx *wpc, struct folio *folio) {struct iomap_folio_state *ifs = folio->private;struct inode *inode = wpc->inode; -u64 pos =folio_pos (folio); -u64 end_pos = pos +folio_size (folio); -u64 end_aligned =0 ; +loff_t pos =folio_pos (folio); +loff_t end_pos = pos +folio_size (folio); +loff_t end_aligned =0 ;size_t bytes_submitted =0 ;int error =0 ;u32 rlen;
fs/xfs/xfs_aops.c +4 -4
@@ -480,9 +480,9 @@ static ssize_txfs_writeback_range ( struct iomap_writepage_ctx *wpc, struct folio *folio, - u64 offset, + loff_t offset, unsigned int len, - u64 end_pos) + loff_t end_pos) { ssize_t ret;
@@ -630,9 +630,9 @@ static ssize_txfs_zoned_writeback_range ( struct iomap_writepage_ctx *wpc, struct folio *folio, - u64 offset, + loff_t offset, unsigned int len, - u64 end_pos) + loff_t end_pos) { ssize_t ret;
fs/zonefs/file.c +2 -1
@@ -126,7 +126,8 @@ static void zonefs_readahead(struct readahead_control *rac)* which implies that the page range can only be within the fixed inode size. */ static ssize_t zonefs_writeback_range (struct iomap_writepage_ctx *wpc, -struct folio *folio,u64 offset,unsigned len,u64 end_pos) +struct folio *folio,loff_t offset,unsigned len, +loff_t end_pos) {struct zonefs_zone *z =zonefs_inode_zone (wpc->inode);
include/linux/iomap.h +2 -2
@@ -442,8 +442,8 @@ struct iomap_writeback_ops {* Returns the number of bytes processed or a negative errno. */ ssize_t (*writeback_range)(struct iomap_writepage_ctx *wpc, -struct folio *folio,u64 pos,unsigned int len, -u64 end_pos); +struct folio *folio,loff_t pos,unsigned int len, +loff_t end_pos);/* * Submit a writeback context previously build up by ->writeback_range.
Signature · 1 line
2.47.3
Re: [PATCH v4 7/9] iomap: use loff_t for file positions and offsets in writeback code
Quoted 3 lines · Joanne Koong
Use
loff_tinstead of u64 for file positions and offsets to be consistent with kernel VFS conventions. Both are 64-bit types.loff_tis signed for historical reasons but this has no practical effect.
generic/303 run fstests generic/303 at 2025-11-19 03:27:51
XFS: Assertion failed: imap.br_startblock != DELAYSTARTBLOCK, file: fs/xfs/xfs_reflink.c, line: 1569
------------[ cut here ]------------ kernel BUG at fs/xfs/xfs_message.c:102! Oops: invalid opcode: 0000 [#1] SMP NOPTI CPU: 8 UID: 0 PID: 2422 Comm: cp Not tainted 6.18.0-rc1-ktest-00035-gb94488503277 #169 NONE Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 RIP: 0010:assfail+0x3c/0x46 Code: c2 e0 cc 40 82 48 89 f1 48 89 fe 48 c7 c7 e3 60 45 82 48 89 e5 e8 e4 fd ff ff 8a 05 16 98 55 01 3c 01 76 02 0f 0b a8 01 74 02 <0f> 0b 0f 0b 5d c3 cc cc cc cc 48 8d 45 10 4c 8d 6c 24 10 48 89 e2 RSP: 0018:ffff888111433cf8 EFLAGS: 00010202 RAX: 00000000ffffff01 RBX: 0007ffffffffffff RCX: 000000007fffffff RDX: 0000000000000021 RSI: 0000000000000000 RDI: ffffffff824560e3 RBP: ffff888111433cf8 R08: 0000000000000000 R09: 000000000000000a R10: 000000000000000a R11: 0fffffffffffffff R12: 0000000000000001 R13: 00000000ffffff8b R14: ffff888105280000 R15: 0007ffffffffffff FS: 00007fc4cd191580(0000) GS:ffff8881f6ccb000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00005612bbfade30 CR3: 000000011146c000 CR4: 0000000000750eb0 PKRU: 55555554 Call Trace: <TASK> xfs_reflink_remap_blocks+0x259/0x450 xfs_file_remap_range+0xe9/0x3d0 vfs_clone_file_range+0xde/0x460 ioctl_file_clone+0x50/0xc0 __x64_sys_ioctl+0x619/0x9d0 ? do_sys_openat2+0x99/0xd0 x64_sys_call+0xed0/0x1da0 do_syscall_64+0x6a/0x2e0 entry_SYSCALL_64_after_hwframe+0x76/0x7e RIP: 0033:0x7fc4cd34d37b Code: 00 48 89 44 24 18 31 c0 48 8d 44 24 60 c7 04 24 10 00 00 00 48 89 44 24 08 48 8d 44 24 20 48 89 44 24 10 b8 10 00 00 00 0f 05 <89> c2 3d 00 f0 ff ff 77 1c 48 8b 44 24 18 64 48 2b 04 25 28 00 00 RSP: 002b:00007ffeb4734050 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 0000000000000004 RCX: 00007fc4cd34d37b RDX: 0000000000000003 RSI: 0000000040049409 RDI: 0000000000000004 RBP: 00007ffeb4734490 R08: 00007ffeb4734660 R09: 0000000000000002 R10: 0000000000000007 R11: 0000000000000246 R12: 0000000000000001 R13: 0000000000000000 R14: 0000000000008000 R15: 0000000000000002 </TASK> Modules linked in: ---[ end trace 0000000000000000 ]--- RIP: 0010:assfail+0x3c/0x46 Code: c2 e0 cc 40 82 48 89 f1 48 89 fe 48 c7 c7 e3 60 45 82 48 89 e5 e8 e4 fd ff ff 8a 05 16 98 55 01 3c 01 76 02 0f 0b a8 01 74 02 <0f> 0b 0f 0b 5d c3 cc cc cc cc 48 8d 45 10 4c 8d 6c 24 10 48 89 e2 RSP: 0018:ffff888111433cf8 EFLAGS: 00010202 RAX: 00000000ffffff01 RBX: 0007ffffffffffff RCX: 000000007fffffff RDX: 0000000000000021 RSI: 0000000000000000 RDI: ffffffff824560e3 RBP: ffff888111433cf8 R08: 0000000000000000 R09: 000000000000000a R10: 000000000000000a R11: 0fffffffffffffff R12: 0000000000000001 R13: 00000000ffffff8b R14: ffff888105280000 R15: 0007ffffffffffff FS: 00007fc4cd191580(0000) GS:ffff8881f6ccb000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00005612bbfade30 CR3: 000000011146c000 CR4: 0000000000750eb0 PKRU: 55555554 Kernel panic - not syncing: Fatal exception Kernel Offset: disabled ---[ end Kernel panic - not syncing: Fatal exception ]---
Re: [PATCH v4 7/9] iomap: use loff_t for file positions and offsets in writeback code
Quoted 54 lines · Matthew Wilcox
Quoted 3 lines · Joanne Koong
Use
loff_tinstead of u64 for file positions and offsets to be consistent with kernel VFS conventions. Both are 64-bit types.loff_tis signed for historical reasons but this has no practical effect.generic/303 run fstests generic/303 at 2025-11-19 03:27:51
XFS: Assertion failed: imap.br_startblock != DELAYSTARTBLOCK, file:fs/xfs/xfs_reflink.c, line: 1569------------[ cut here ]------------ kernel BUG at fs/xfs/xfs_message.c:102! Oops: invalid opcode: 0000 [#1] SMP NOPTI CPU: 8 UID: 0 PID: 2422 Comm: cp Not tainted 6.18.0-rc1-ktest-00035-gb94488503277 #169 NONE Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 RIP: 0010:assfail+0x3c/0x46 Code: c2 e0 cc 40 82 48 89 f1 48 89 fe 48 c7 c7 e3 60 45 82 48 89 e5 e8 e4 fd ff ff 8a 05 16 98 55 01 3c 01 76 02 0f 0b a8 01 74 02 <0f> 0b 0f 0b 5d c3 cc cc cc cc 48 8d 45 10 4c 8d 6c 24 10 48 89 e2 RSP: 0018:ffff888111433cf8 EFLAGS: 00010202 RAX: 00000000ffffff01 RBX: 0007ffffffffffff RCX: 000000007fffffff RDX: 0000000000000021 RSI: 0000000000000000 RDI: ffffffff824560e3 RBP: ffff888111433cf8 R08: 0000000000000000 R09: 000000000000000a R10: 000000000000000a R11: 0fffffffffffffff R12: 0000000000000001 R13: 00000000ffffff8b R14: ffff888105280000 R15: 0007ffffffffffff FS: 00007fc4cd191580(0000) GS:ffff8881f6ccb000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00005612bbfade30 CR3: 000000011146c000 CR4: 0000000000750eb0 PKRU: 55555554 Call Trace: <TASK> xfs_reflink_remap_blocks+0x259/0x450 xfs_file_remap_range+0xe9/0x3d0 vfs_clone_file_range+0xde/0x460 ioctl_file_clone+0x50/0xc0 __x64_sys_ioctl+0x619/0x9d0 ? do_sys_openat2+0x99/0xd0 x64_sys_call+0xed0/0x1da0 do_syscall_64+0x6a/0x2e0 entry_SYSCALL_64_after_hwframe+0x76/0x7e RIP: 0033:0x7fc4cd34d37b Code: 00 48 89 44 24 18 31 c0 48 8d 44 24 60 c7 04 24 10 00 00 00 48 89 44 24 08 48 8d 44 24 20 48 89 44 24 10 b8 10 00 00 00 0f 05 <89> c2 3d 00 f0 ff ff 77 1c 48 8b 44 24 18 64 48 2b 04 25 28 00 00 RSP: 002b:00007ffeb4734050 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 0000000000000004 RCX: 00007fc4cd34d37b RDX: 0000000000000003 RSI: 0000000040049409 RDI: 0000000000000004 RBP: 00007ffeb4734490 R08: 00007ffeb4734660 R09: 0000000000000002 R10: 0000000000000007 R11: 0000000000000246 R12: 0000000000000001 R13: 0000000000000000 R14: 0000000000008000 R15: 0000000000000002 </TASK> Modules linked in: ---[ end trace 0000000000000000 ]--- RIP: 0010:assfail+0x3c/0x46 Code: c2 e0 cc 40 82 48 89 f1 48 89 fe 48 c7 c7 e3 60 45 82 48 89 e5 e8 e4 fd ff ff 8a 05 16 98 55 01 3c 01 76 02 0f 0b a8 01 74 02 <0f> 0b 0f 0b 5d c3 cc cc cc cc 48 8d 45 10 4c 8d 6c 24 10 48 89 e2 RSP: 0018:ffff888111433cf8 EFLAGS: 00010202 RAX: 00000000ffffff01 RBX: 0007ffffffffffff RCX: 000000007fffffff RDX: 0000000000000021 RSI: 0000000000000000 RDI: ffffffff824560e3 RBP: ffff888111433cf8 R08: 0000000000000000 R09: 000000000000000a R10: 000000000000000a R11: 0fffffffffffffff R12: 0000000000000001
Quoted 9 lines
R13: 00000000ffffff8b R14: ffff888105280000 R15: 0007ffffffffffff FS: 00007fc4cd191580(0000) GS:ffff8881f6ccb000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00005612bbfade30 CR3: 000000011146c000 CR4: 0000000000750eb0 PKRU: 55555554 Kernel panic - not syncing: Fatal exception Kernel Offset: disabled ---[ end Kernel panic - not syncing: Fatal exception ]---
First off, it's becoming clear to me that I didn't test this patchset adequately enough. I had run xfstests on fuse but didn't run it on XFS. My apologies for that, I should have done that and caught these bugs myself, and will certainly do so next time.
For this test failure, it's because the change from u64 to loff_t is overflowing loff_t on xfs. The failure is coming from this line change in particular:
-static unsigned iomap_find_dirty_range(struct folio *folio, u64 *range_start,
- u64 range_end)
+static unsigned iomap_find_dirty_range(struct folio *folio, loff_t *range_start,
+ loff_t range_end)
which is called when writing back the folio (in iomap_writeback_folio()).
I added some printks and it's overflowing because we are trying to write back a 4096-byte folio starting at position 9223372036854771712 (2^63 - 4096) in the file which results in an overflowed end_pos of 9223372036854775808 (2^63) when calculating folio_pos + folio_size.
I'm assuming XFS uses these large folio positions as a sentinel/marker and that it's not actually a folio at position 9223372036854771712, but either way, this patch doesn't seem viable with how XFS currently works and I think it needs to get dropped.
I'm going to run the rest of the xfstests suite on XFS for this patchset series to verify there are no other issues.
Thanks,
Joanne
Re: [PATCH v4 7/9] iomap: use loff_t for file positions and offsets in writeback code
Quoted 87 lines · Joanne Koong
Quoted 54 lines · Matthew Wilcox
Quoted 3 lines · Joanne Koong
Use
loff_tinstead of u64 for file positions and offsets to be consistent with kernel VFS conventions. Both are 64-bit types.loff_tis signed for historical reasons but this has no practical effect.generic/303 run fstests generic/303 at 2025-11-19 03:27:51
XFS: Assertion failed: imap.br_startblock != DELAYSTARTBLOCK, file:fs/xfs/xfs_reflink.c, line: 1569------------[ cut here ]------------ kernel BUG at fs/xfs/xfs_message.c:102! Oops: invalid opcode: 0000 [#1] SMP NOPTI CPU: 8 UID: 0 PID: 2422 Comm: cp Not tainted 6.18.0-rc1-ktest-00035-gb94488503277 #169 NONE Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 RIP: 0010:assfail+0x3c/0x46 Code: c2 e0 cc 40 82 48 89 f1 48 89 fe 48 c7 c7 e3 60 45 82 48 89 e5 e8 e4 fd ff ff 8a 05 16 98 55 01 3c 01 76 02 0f 0b a8 01 74 02 <0f> 0b 0f 0b 5d c3 cc cc cc cc 48 8d 45 10 4c 8d 6c 24 10 48 89 e2 RSP: 0018:ffff888111433cf8 EFLAGS: 00010202 RAX: 00000000ffffff01 RBX: 0007ffffffffffff RCX: 000000007fffffff RDX: 0000000000000021 RSI: 0000000000000000 RDI: ffffffff824560e3 RBP: ffff888111433cf8 R08: 0000000000000000 R09: 000000000000000a R10: 000000000000000a R11: 0fffffffffffffff R12: 0000000000000001 R13: 00000000ffffff8b R14: ffff888105280000 R15: 0007ffffffffffff FS: 00007fc4cd191580(0000) GS:ffff8881f6ccb000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00005612bbfade30 CR3: 000000011146c000 CR4: 0000000000750eb0 PKRU: 55555554 Call Trace: <TASK> xfs_reflink_remap_blocks+0x259/0x450 xfs_file_remap_range+0xe9/0x3d0 vfs_clone_file_range+0xde/0x460 ioctl_file_clone+0x50/0xc0 __x64_sys_ioctl+0x619/0x9d0 ? do_sys_openat2+0x99/0xd0 x64_sys_call+0xed0/0x1da0 do_syscall_64+0x6a/0x2e0 entry_SYSCALL_64_after_hwframe+0x76/0x7e RIP: 0033:0x7fc4cd34d37b Code: 00 48 89 44 24 18 31 c0 48 8d 44 24 60 c7 04 24 10 00 00 00 48 89 44 24 08 48 8d 44 24 20 48 89 44 24 10 b8 10 00 00 00 0f 05 <89> c2 3d 00 f0 ff ff 77 1c 48 8b 44 24 18 64 48 2b 04 25 28 00 00 RSP: 002b:00007ffeb4734050 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 0000000000000004 RCX: 00007fc4cd34d37b RDX: 0000000000000003 RSI: 0000000040049409 RDI: 0000000000000004 RBP: 00007ffeb4734490 R08: 00007ffeb4734660 R09: 0000000000000002 R10: 0000000000000007 R11: 0000000000000246 R12: 0000000000000001 R13: 0000000000000000 R14: 0000000000008000 R15: 0000000000000002 </TASK> Modules linked in: ---[ end trace 0000000000000000 ]--- RIP: 0010:assfail+0x3c/0x46 Code: c2 e0 cc 40 82 48 89 f1 48 89 fe 48 c7 c7 e3 60 45 82 48 89 e5 e8 e4 fd ff ff 8a 05 16 98 55 01 3c 01 76 02 0f 0b a8 01 74 02 <0f> 0b 0f 0b 5d c3 cc cc cc cc 48 8d 45 10 4c 8d 6c 24 10 48 89 e2 RSP: 0018:ffff888111433cf8 EFLAGS: 00010202 RAX: 00000000ffffff01 RBX: 0007ffffffffffff RCX: 000000007fffffff RDX: 0000000000000021 RSI: 0000000000000000 RDI: ffffffff824560e3 RBP: ffff888111433cf8 R08: 0000000000000000 R09: 000000000000000a R10: 000000000000000a R11: 0fffffffffffffff R12: 0000000000000001Quoted 9 lines
R13: 00000000ffffff8b R14: ffff888105280000 R15: 0007ffffffffffff FS: 00007fc4cd191580(0000) GS:ffff8881f6ccb000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00005612bbfade30 CR3: 000000011146c000 CR4: 0000000000750eb0 PKRU: 55555554 Kernel panic - not syncing: Fatal exception Kernel Offset: disabled ---[ end Kernel panic - not syncing: Fatal exception ]---First off, it's becoming clear to me that I didn't test this patchset adequately enough. I had run xfstests on fuse but didn't run it on XFS. My apologies for that, I should have done that and caught these bugs myself, and will certainly do so next time.
For this test failure, it's because the change from u64 to
loff_tis overflowingloff_ton xfs. The failure is coming from this line change in particular:fs/iomap/buffered-io.c +1
-2-static unsigned iomap_find_dirty_range (struct folio *folio,u64 *range_start, -u64 range_end) +static unsigned iomap_find_dirty_range(struct folio *folio, loff_t
*range_start,
+loff_trange_end)which is called when writing back the folio (in
iomap_writeback_folio()).I added some printks and it's overflowing because we are trying to write back a 4096-byte folio starting at position 9223372036854771712 (2^63 - 4096) in the file which results in an overflowed
end_posof 9223372036854775808 (2^63) when calculatingfolio_pos+folio_size.
Quoted 4 lines
I'm assuming XFS uses these large folio positions as a sentinel/marker and that it's not actually a folio at position 9223372036854771712, but either way, this patch doesn't seem viable with how XFS currently works and I think it needs to get dropped.
xfs supports 9223372036854775807-byte files, so 0x7FFFFFFFFFFFF000 is a valid location for a folio.
--D
Quoted 5 lines
I'm going to run the rest of the xfstests suite on XFS for this patchset series to verify there are no other issues.
Thanks,
Joanne
Re: [PATCH v4 7/9] iomap: use loff_t for file positions and offsets in writeback code
Quoted 89 lines · Darrick J. Wong
Quoted 87 lines · Joanne Koong
Quoted 54 lines · Matthew Wilcox
Quoted 3 lines · Joanne Koong
Use
loff_tinstead of u64 for file positions and offsets to be consistent with kernel VFS conventions. Both are 64-bit types.loff_tis signed for historical reasons but this has no practical effect.generic/303 run fstests generic/303 at 2025-11-19 03:27:51
XFS: Assertion failed: imap.br_startblock != DELAYSTARTBLOCK, file:fs/xfs/xfs_reflink.c, line: 1569------------[ cut here ]------------ kernel BUG at fs/xfs/xfs_message.c:102! Oops: invalid opcode: 0000 [#1] SMP NOPTI CPU: 8 UID: 0 PID: 2422 Comm: cp Not tainted 6.18.0-rc1-ktest-00035-gb94488503277 #169 NONE Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 RIP: 0010:assfail+0x3c/0x46 Code: c2 e0 cc 40 82 48 89 f1 48 89 fe 48 c7 c7 e3 60 45 82 48 89 e5 e8 e4 fd ff ff 8a 05 16 98 55 01 3c 01 76 02 0f 0b a8 01 74 02 <0f> 0b 0f 0b 5d c3 cc cc cc cc 48 8d 45 10 4c 8d 6c 24 10 48 89 e2 RSP: 0018:ffff888111433cf8 EFLAGS: 00010202 RAX: 00000000ffffff01 RBX: 0007ffffffffffff RCX: 000000007fffffff RDX: 0000000000000021 RSI: 0000000000000000 RDI: ffffffff824560e3 RBP: ffff888111433cf8 R08: 0000000000000000 R09: 000000000000000a R10: 000000000000000a R11: 0fffffffffffffff R12: 0000000000000001 R13: 00000000ffffff8b R14: ffff888105280000 R15: 0007ffffffffffff FS: 00007fc4cd191580(0000) GS:ffff8881f6ccb000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00005612bbfade30 CR3: 000000011146c000 CR4: 0000000000750eb0 PKRU: 55555554 Call Trace: <TASK> xfs_reflink_remap_blocks+0x259/0x450 xfs_file_remap_range+0xe9/0x3d0 vfs_clone_file_range+0xde/0x460 ioctl_file_clone+0x50/0xc0 __x64_sys_ioctl+0x619/0x9d0 ? do_sys_openat2+0x99/0xd0 x64_sys_call+0xed0/0x1da0 do_syscall_64+0x6a/0x2e0 entry_SYSCALL_64_after_hwframe+0x76/0x7e RIP: 0033:0x7fc4cd34d37b Code: 00 48 89 44 24 18 31 c0 48 8d 44 24 60 c7 04 24 10 00 00 00 48 89 44 24 08 48 8d 44 24 20 48 89 44 24 10 b8 10 00 00 00 0f 05 <89> c2 3d 00 f0 ff ff 77 1c 48 8b 44 24 18 64 48 2b 04 25 28 00 00 RSP: 002b:00007ffeb4734050 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 0000000000000004 RCX: 00007fc4cd34d37b RDX: 0000000000000003 RSI: 0000000040049409 RDI: 0000000000000004 RBP: 00007ffeb4734490 R08: 00007ffeb4734660 R09: 0000000000000002 R10: 0000000000000007 R11: 0000000000000246 R12: 0000000000000001 R13: 0000000000000000 R14: 0000000000008000 R15: 0000000000000002 </TASK> Modules linked in: ---[ end trace 0000000000000000 ]--- RIP: 0010:assfail+0x3c/0x46 Code: c2 e0 cc 40 82 48 89 f1 48 89 fe 48 c7 c7 e3 60 45 82 48 89 e5 e8 e4 fd ff ff 8a 05 16 98 55 01 3c 01 76 02 0f 0b a8 01 74 02 <0f> 0b 0f 0b 5d c3 cc cc cc cc 48 8d 45 10 4c 8d 6c 24 10 48 89 e2 RSP: 0018:ffff888111433cf8 EFLAGS: 00010202 RAX: 00000000ffffff01 RBX: 0007ffffffffffff RCX: 000000007fffffff RDX: 0000000000000021 RSI: 0000000000000000 RDI: ffffffff824560e3 RBP: ffff888111433cf8 R08: 0000000000000000 R09: 000000000000000a R10: 000000000000000a R11: 0fffffffffffffff R12: 0000000000000001Quoted 9 lines
R13: 00000000ffffff8b R14: ffff888105280000 R15: 0007ffffffffffff FS: 00007fc4cd191580(0000) GS:ffff8881f6ccb000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00005612bbfade30 CR3: 000000011146c000 CR4: 0000000000750eb0 PKRU: 55555554 Kernel panic - not syncing: Fatal exception Kernel Offset: disabled ---[ end Kernel panic - not syncing: Fatal exception ]---First off, it's becoming clear to me that I didn't test this patchset adequately enough. I had run xfstests on fuse but didn't run it on XFS. My apologies for that, I should have done that and caught these bugs myself, and will certainly do so next time.
For this test failure, it's because the change from u64 to
loff_tis overflowingloff_ton xfs. The failure is coming from this line change in particular:fs/iomap/buffered-io.c +1
-2-static unsigned iomap_find_dirty_range (struct folio *folio,u64 *range_start, -u64 range_end) +static unsigned iomap_find_dirty_range(struct folio *folio, loff_t
*range_start,
+loff_trange_end)which is called when writing back the folio (in
iomap_writeback_folio()).I added some printks and it's overflowing because we are trying to write back a 4096-byte folio starting at position 9223372036854771712 (2^63 - 4096) in the file which results in an overflowed
end_posof 9223372036854775808 (2^63) when calculatingfolio_pos+folio_size.
Quoted 7 lines
Quoted 4 lines
I'm assuming XFS uses these large folio positions as a sentinel/marker and that it's not actually a folio at position 9223372036854771712, but either way, this patch doesn't seem viable with how XFS currently works and I think it needs to get dropped.
xfs supports 9223372036854775807-byte files, so
0x7FFFFFFFFFFFF000is a valid location for a folio.
Is 9223372036854775807 the last valid file position supported on xfs or does xfs also support positions beyond that?
Thanks,
Joanne
Quoted 8 lines
--D
Quoted 5 lines
I'm going to run the rest of the xfstests suite on XFS for this patchset series to verify there are no other issues.
Thanks,
Joanne
Re: [PATCH v4 7/9] iomap: use loff_t for file positions and offsets in writeback code
Quoted 6 lines · Joanne Koong
Quoted 2 lines · Darrick J. Wong
xfs supports 9223372036854775807-byte files, so
0x7FFFFFFFFFFFF000is a valid location for a folio.Is 9223372036854775807 the last valid file position supported on xfs or does xfs also support positions beyond that?
#if BITS_PER_LONG==32
#define MAX_LFS_FILESIZE ((loff_t)ULONG_MAX << PAGE_SHIFT)
#elif BITS_PER_LONG==64
#define MAX_LFS_FILESIZE ((loff_t)LLONG_MAX)
#endif
Linux declines to support files beyond 2^63-1. Today, anyway.
Re: [PATCH v4 7/9] iomap: use loff_t for file positions and offsets in writeback code
Quoted 9 lines · Matthew Wilcox
Quoted 6 lines · Joanne Koong
Quoted 2 lines · Darrick J. Wong
xfs supports 9223372036854775807-byte files, so
0x7FFFFFFFFFFFF000is a valid location for a folio.Is 9223372036854775807 the last valid file position supported on xfs or does xfs also support positions beyond that?
Quoted 7 lines
#if BITS_PER_LONG==32
#defineMAX_LFS_FILESIZE((loff_t)ULONG_MAX <<PAGE_SHIFT)
#elif BITS_PER_LONG==64
#defineMAX_LFS_FILESIZE((loff_t)LLONG_MAX)
#endifLinux declines to support files beyond 2^63-1. Today, anyway.
Ah I see, thanks.
I was wrong then - it's not an xfs specific thing, 9223372036854775807 is a valid file position on other filesystems as well.
I think it's best to drop this patch. If we were to keep it, accounting for the loff_t overflow in "end_pos" and "end_aligned" makes the whole thing look worse and more confusing.
Christian, could you please drop this patch from your iomap vfs tree?
Thanks,
Joanne
Christian Brauner
maintainerRe: [PATCH v4 7/9] iomap: use loff_t for file positions and offsets in writeback code
Quoted 1 line
Christian, could you please drop this patch from your iomap vfs tree?
Done.
PATCH v4 8/9 iomap: use find_next_bit() for dirty bitmap scanning
In reply to Joanne KoongUse find_next_bit()/find_next_zero_bit() for iomap dirty bitmap scanning. This uses __ffs() internally and is more efficient for finding the next dirty or clean bit than iterating through the bitmap range testing every bit.
--- fs/iomap/buffered-io.c | 61 ++++++++++++++++++++++++++++-------------- 1 file changed, 41 insertions(+), 20 deletions(-)
fs/iomap/buffered-io.c +41 -20
@@ -76,13 +76,34 @@ static void iomap_set_range_uptodate(struct folio *folio, size_t off,folio_mark_uptodate (folio); } -static inline bool ifs_block_is_dirty (struct folio *folio, -struct iomap_folio_state *ifs,int block) +/* +* Find the next dirty block in the folio. end_blk is inclusive. +* If no dirty block is found, this will return end_blk + 1. +*/ +static unsigned ifs_next_dirty_block (struct folio *folio, +unsigned start_blk,unsigned end_blk) { +struct iomap_folio_state *ifs = folio->private;struct inode *inode = folio->mapping->host; -unsigned int blks_per_folio =i_blocks_per_folio (inode, folio); +unsigned int blks =i_blocks_per_folio (inode, folio); + +return find_next_bit (ifs->state, blks + end_blk +1 , + blks + start_blk) - blks; +} + +/* +* Find the next clean block in the folio. end_blk is inclusive. +* If no clean block is found, this will return end_blk + 1. +*/ +static unsigned ifs_next_clean_block (struct folio *folio, +unsigned start_blk,unsigned end_blk) +{ +struct iomap_folio_state *ifs = folio->private; +struct inode *inode = folio->mapping->host; +unsigned int blks =i_blocks_per_folio (inode, folio); -return test_bit (block + blks_per_folio, ifs->state); +return find_next_zero_bit (ifs->state, blks + end_blk +1 , + blks + start_blk) - blks; } static unsigned ifs_find_dirty_range(struct folio *folio,
@@ -94,18 +115,17 @@ static unsigned ifs_find_dirty_range(struct folio *folio,offset_in_folio (folio, *range_start) >> inode->i_blkbits;unsigned end_blk =min_not_zero (offset_in_folio (folio, range_end) >> inode->i_blkbits, -i_blocks_per_folio (inode, folio)); -unsigned nblks =1 ; - -while (!ifs_block_is_dirty (folio, ifs, start_blk)) -if (++start_blk == end_blk) -return 0 ; +i_blocks_per_folio (inode, folio)) -1 ; +unsigned nblks; -while (start_blk + nblks < end_blk) { -if (!ifs_block_is_dirty (folio, ifs, start_blk + nblks)) -break ; - nblks++; - } + start_blk =ifs_next_dirty_block (folio, start_blk, end_blk); +if (start_blk > end_blk) +return 0 ; +if (start_blk == end_blk) + nblks =1 ; +else + nblks =ifs_next_clean_block (folio, start_blk +1 , end_blk) - + start_blk; *range_start =folio_pos (folio) + (start_blk << inode->i_blkbits);return nblks << inode->i_blkbits;
@@ -1167,7 +1187,7 @@ static void iomap_write_delalloc_ifs_punch(struct inode *inode, struct folio *folio, loff_t start_byte, loff_t end_byte, struct iomap *iomap, iomap_punch_t punch) { - unsigned int first_blk, last_blk, i; + unsigned int first_blk, last_blk;loff_t last_byte;u8 blkbits = inode->i_blkbits;struct iomap_folio_state *ifs;
@@ -1186,10 +1206,11 @@ static void iomap_write_delalloc_ifs_punch(struct inode *inode, folio_pos(folio) + folio_size(folio) - 1); first_blk =offset_in_folio (folio, start_byte) >> blkbits; last_blk =offset_in_folio (folio, last_byte) >> blkbits; -for (i = first_blk; i <= last_blk; i++) { -if (!ifs_block_is_dirty (folio, ifs, i)) -punch (inode,folio_pos (folio) + (i << blkbits), -1 << blkbits, iomap); +while ((first_blk =ifs_next_clean_block (folio, first_blk, last_blk)) + <= last_blk) { +punch (inode,folio_pos (folio) + (first_blk << blkbits), +1 << blkbits, iomap); + first_blk++; } }
Signature · 1 line
2.47.3
PATCH v4 9/9 iomap: use find_next_bit() for uptodate bitmap scanning
In reply to Joanne KoongUse find_next_bit()/find_next_zero_bit() for iomap uptodate bitmap scanning. This uses __ffs() internally and is more efficient for finding the next uptodate or non-uptodate bit than iterating through the the bitmap range testing every bit.
--- fs/iomap/buffered-io.c | 52 ++++++++++++++++++++++++++---------------- 1 file changed, 32 insertions(+), 20 deletions(-)
fs/iomap/buffered-io.c +32 -20
@@ -38,10 +38,28 @@ static inline bool ifs_is_fully_uptodate(struct folio *folio,return bitmap_full (ifs->state,i_blocks_per_folio (inode, folio)); } -static inline bool ifs_block_is_uptodate (struct iomap_folio_state *ifs, -unsigned int block) +/* +* Find the next uptodate block in the folio. end_blk is inclusive. +* If no uptodate block is found, this will return end_blk + 1. +*/ +static unsigned ifs_next_uptodate_block (struct folio *folio, +unsigned start_blk,unsigned end_blk) { -return test_bit (block, ifs->state); +struct iomap_folio_state *ifs = folio->private; + +return find_next_bit (ifs->state, end_blk +1 , start_blk); +} + +/* +* Find the next non-uptodate block in the folio. end_blk is inclusive. +* If no non-uptodate block is found, this will return end_blk + 1. +*/ +static unsigned ifs_next_nonuptodate_block (struct folio *folio, +unsigned start_blk,unsigned end_blk) +{ +struct iomap_folio_state *ifs = folio->private; + +return find_next_zero_bit (ifs->state, end_blk +1 , start_blk); } static bool ifs_set_range_uptodate(struct folio *folio,
@@ -278,14 +296,11 @@ static void iomap_adjust_read_range(struct inode *inode, struct folio *folio,* to avoid reading in already uptodate ranges. */ if (ifs) { -unsigned int i, blocks_skipped; +unsigned int next, blocks_skipped; -/* move forward for each leading block marked uptodate */ -for (i = first; i <= last; i++) -if (!ifs_block_is_uptodate (ifs, i)) -break ; + next =ifs_next_nonuptodate_block (folio, first, last); + blocks_skipped = next - first; - blocks_skipped = i - first;if (blocks_skipped) {unsigned long block_offset = *pos & (block_size -1 ); unsigned bytes_skipped =
@@ -295,15 +310,15 @@ static void iomap_adjust_read_range(struct inode *inode, struct folio *folio, poff += bytes_skipped; plen -= bytes_skipped; } - first = i; + first = next;/* truncate len if we find any trailing uptodate block(s) */ -while (++i <= last) { -if (ifs_block_is_uptodate (ifs, i)) { +if (++next <= last) { + next =ifs_next_uptodate_block (folio, next, last); +if (next <= last) { plen -=iomap_bytes_to_truncate (*pos + plen, - block_bits, last - i +1 ); - last = i -1 ; -break ; + block_bits, last - next +1 ); + last = next -1 ; } } }
@@ -640,7 +655,7 @@ bool iomap_is_partially_uptodate(struct folio *folio, size_t from, size_t count) {struct iomap_folio_state *ifs = folio->private;struct inode *inode = folio->mapping->host; -unsigned first, last, i; +unsigned first, last;if (!ifs)return false;
@@ -652,10 +667,7 @@ bool iomap_is_partially_uptodate(struct folio *folio, size_t from, size_t count) first = from >> inode->i_blkbits; last = (from + count -1 ) >> inode->i_blkbits; -for (i = first; i <= last; i++) -if (!ifs_block_is_uptodate (ifs, i)) -return false; -return true; +return ifs_next_nonuptodate_block (folio, first, last) > last; }EXPORT_SYMBOL_GPL (iomap_is_partially_uptodate);
Signature · 1 line
2.47.3
Quoted 10 lines · Joanne Koong
This series is on top of the vfs-6.19.iomap branch (head commit
ca3557a68684) in Christian's vfs tree.Thanks,
JoanneChangelog
---------[...]
Applied to the vfs-6.19.iomap branch of the vfs/vfs.git tree. Patches in the vfs-6.19.iomap branch should appear in linux-next soon.
Please report any outstanding bugs that were missed during review in a new review to the original patch series allowing us to drop it.
It's encouraged to provide Acked-bys and Reviewed-bys even though the patch has now been applied. If possible patch trailers will be updated.
Note that commit hashes shown below are subject to change due to rebase, trailer updates or similar. If in doubt, please check the listed branch.
tree: https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git branch: vfs-6.19.iomap
[1/9] iomap: rename bytes_pending/bytes_accounted to bytes_submitted/bytes_not_submitted
https://git.kernel.org/vfs/vfs/c/a0f1cabe294c [2/9] iomap: account for unaligned end offsets when truncating read range https://git.kernel.org/vfs/vfs/c/9d875e0eef8e [3/9] docs: document iomap writeback's iomap_finish_folio_write() requirement https://git.kernel.org/vfs/vfs/c/7e6cea5ae2f5 [4/9] iomap: optimize pending async writeback accounting https://git.kernel.org/vfs/vfs/c/6b1fd2281fb0 [5/9] iomap: simplify ->read_folio_range() error handling for reads https://git.kernel.org/vfs/vfs/c/f8eaf79406fe [6/9] iomap: simplify when reads can be skipped for writes https://git.kernel.org/vfs/vfs/c/a298febc47e0 [7/9] iomap: use loff_t for file positions and offsets in writeback code https://git.kernel.org/vfs/vfs/c/b94488503277 [8/9] iomap: use find_next_bit() for dirty bitmap scanning https://git.kernel.org/vfs/vfs/c/e46cdbfa2029 [9/9] iomap: use find_next_bit() for uptodate bitmap scanning https://git.kernel.org/vfs/vfs/c/608f00b56c31