Handle ENOBUFS from the extent allocator in the write paths

We can get ENOBUFS when trying to allocate an extent if we've
exhausted our local supply of extents. Rather than returning this
error all the way back to user space, do what the pre-iomap write
paths did and drop our inode lock, release the transaction, and retry.
This gives the allocator an opportunity to refresh its extent pool.

Signed-off-by: Chris Kirby <ckirby@versity.com>
This commit is contained in:
Chris Kirby
2026-10-13 13:28:09 -05:00
parent 8fbdca8750
commit fcbfdc0a88
+8
View File
@@ -368,8 +368,12 @@ retry:
out:
if (locked) {
unlock_for_iomap_write(inode, scoutfs_inode_lock, &ind_locks, written);
locked = false;
}
if (ret == -ENOBUFS)
goto retry;
return ret < 0 ? ret : written;
}
@@ -435,8 +439,12 @@ retry:
out:
if (locked) {
unlock_for_iomap_write(inode, scoutfs_inode_lock, &ind_locks, written);
locked = false;
}
if (ret == -ENOBUFS)
goto retry;
if (written > 0 && ((orig_pos + written) & BACKGROUND_WRITEBACK_MASK) == 0) {
scoutfs_writepages_sync_none(file->f_mapping,
orig_pos + written - BACKGROUND_WRITEBACK_BYTES,