mirror of
https://github.com/versity/scoutfs.git
synced 2026-10-22 14:22:42 +00:00
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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user