summaryrefslogtreecommitdiff
path: root/fs/bcachefs/fs-io.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2019-04-17 22:49:28 +0300
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-23 00:08:20 +0300
commit94f651e2c7e2808e82673b46776f951a67da4a2d (patch)
tree18ae9ea3df4e9c5f2bfa491d3efe722e5443f5c5 /fs/bcachefs/fs-io.c
parent201a4d4cbed532c73d83ea9ea8166f40e9faa1e1 (diff)
downloadlinux-94f651e2c7e2808e82673b46776f951a67da4a2d.tar.xz
bcachefs: Return errors from for_each_btree_key()
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/fs-io.c')
-rw-r--r--fs/bcachefs/fs-io.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/bcachefs/fs-io.c b/fs/bcachefs/fs-io.c
index c8f6104553aa..f76dd4d89f25 100644
--- a/fs/bcachefs/fs-io.c
+++ b/fs/bcachefs/fs-io.c
@@ -2139,7 +2139,7 @@ static inline int range_has_data(struct bch_fs *c,
bch2_trans_init(&trans, c);
- for_each_btree_key(&trans, iter, BTREE_ID_EXTENTS, start, 0, k) {
+ for_each_btree_key(&trans, iter, BTREE_ID_EXTENTS, start, 0, k, ret) {
if (bkey_cmp(bkey_start_pos(k.k), end) >= 0)
break;
@@ -2732,7 +2732,7 @@ static loff_t bch2_seek_data(struct file *file, u64 offset)
bch2_trans_init(&trans, c);
for_each_btree_key(&trans, iter, BTREE_ID_EXTENTS,
- POS(inode->v.i_ino, offset >> 9), 0, k) {
+ POS(inode->v.i_ino, offset >> 9), 0, k, ret) {
if (k.k->p.inode != inode->v.i_ino) {
break;
} else if (bkey_extent_is_data(k.k)) {
@@ -2742,7 +2742,7 @@ static loff_t bch2_seek_data(struct file *file, u64 offset)
break;
}
- ret = bch2_trans_exit(&trans);
+ ret = bch2_trans_exit(&trans) ?: ret;
if (ret)
return ret;
@@ -2806,7 +2806,7 @@ static loff_t bch2_seek_hole(struct file *file, u64 offset)
for_each_btree_key(&trans, iter, BTREE_ID_EXTENTS,
POS(inode->v.i_ino, offset >> 9),
- BTREE_ITER_SLOTS, k) {
+ BTREE_ITER_SLOTS, k, ret) {
if (k.k->p.inode != inode->v.i_ino) {
next_hole = bch2_next_pagecache_hole(&inode->v,
offset, MAX_LFS_FILESIZE);
@@ -2823,7 +2823,7 @@ static loff_t bch2_seek_hole(struct file *file, u64 offset)
}
}
- ret = bch2_trans_exit(&trans);
+ ret = bch2_trans_exit(&trans) ?: ret;
if (ret)
return ret;