diff options
| author | Brian Foster <[email protected]> | 2023-08-14 14:49:42 +0000 |
|---|---|---|
| committer | Kent Overstreet <[email protected]> | 2023-10-22 21:10:11 +0000 |
| commit | 8c9b0f7bdc4183573d57f0442693d99cc9758617 (patch) | |
| tree | cefa2eeb55d171b36a7994cf27e4e8511d298b14 /fs/bcachefs/btree_trans_commit.c | |
| parent | bcachefs: Fix bkey format calculation (diff) | |
| download | kernel-8c9b0f7bdc4183573d57f0442693d99cc9758617.tar.gz kernel-8c9b0f7bdc4183573d57f0442693d99cc9758617.zip | |
bcachefs: fix up wonky error handling in bch2_seek_pagecache_hole()
The folio_hole_offset() helper returns a mix of bool and int types.
The latter is to support a possible -EAGAIN error code when using
nonblocking locks. This is not only confusing, but the only caller
also essentially ignores errors outside of stopping the range
iteration. This means an -EAGAIN error can't return directly from
folio_hole_offset() and may be lost via bch2_clamp_data_hole().
Fix up the error handling and make it more readable.
__filemap_get_folio() returns -ENOENT instead of NULL when no folio
exists, so reuse the same error code in folio_hole_offset(). Fix up
bch2_seek_pagecache_hole() to return the current offset on -ENOENT,
but otherwise return unexpected error code up to the caller.
Signed-off-by: Brian Foster <[email protected]>
Signed-off-by: Kent Overstreet <[email protected]>
Diffstat (limited to 'fs/bcachefs/btree_trans_commit.c')
0 files changed, 0 insertions, 0 deletions
