Skip to contentSkip to conversation

bcachefs: __bchfs_fallocate() now checks for pending signals

PATCH New Kent Overstreet 1 participant 1 message Mar 23, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bcachefs: __bchfs_fallocate() now checks for pending signals

This can be an operation with very long latenc, if terabytes are requested.

---
 fs/bcachefs/fs-io.c | 4 ++++
 1 file changed, 4 insertions(+)
fs/bcachefs/fs-io.c +4 -0
index 717e7b94c66f..3dcb0a165401 100644
@@ -626,6 +626,10 @@ static noinline int __bchfs_fallocate(struct bch_inode_info *inode, int mode,
 		u64 hole_start, hole_end;
 		u32 snapshot;
 
+		ret = unlikely(signal_pending(current)) ? -ERESTARTSYS : 0;
+		if (ret)
+			break;
+
 		bch2_trans_begin(trans);
 
 		if (bkey_ge(iter.pos, end_pos))
Signature · 1 line
2.49.0