Skip to contentSkip to conversation

bcachefs: Fix unhandled transaction restart in fallocate

PATCH New Kent Overstreet 1 participant 1 message Oct 26, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bcachefs: Fix unhandled transaction restart in fallocate

This used to not matter, but now we're being more strict.

---
 fs/bcachefs/fs-io.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
fs/bcachefs/fs-io.c +4 -1
index 15d3f073b824..8cfd17beb171 100644
@@ -634,12 +634,15 @@ static noinline int __bchfs_fallocate(struct bch_inode_info *inode, int mode,
 			if (bch2_clamp_data_hole(&inode->v,
 						 &hole_start,
 						 &hole_end,
-						 opts.data_replicas, true))
+						 opts.data_replicas, true)) {
 				ret = drop_locks_do(trans,
 					(bch2_clamp_data_hole(&inode->v,
 							      &hole_start,
 							      &hole_end,
 							      opts.data_replicas, false), 0));
+				if (ret)
+					goto bkey_err;
+			}
 			bch2_btree_iter_set_pos(&iter, POS(iter.pos.inode, hole_start));
 
 			if (ret)
Signature · 1 line
2.45.2