Skip to content

Commit 58777f1

Browse files
committed
Allow block cloning to be interrupted by a signal.
Even though block cloning is much faster than regular copying, it is not instantaneous - the file might be large and the recordsize small. It would be nice to be able to interrupt it with a signal (e.g., SIGINFO on FreeBSD to see the progress). Signed-off-by: Pawel Jakub Dawidek <[email protected]>
1 parent efbef9e commit 58777f1

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

module/zfs/zfs_vnops.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1309,6 +1309,11 @@ zfs_clone_range(znode_t *inzp, uint64_t *inoffp, znode_t *outzp,
13091309
break;
13101310
}
13111311

1312+
if (issig(JUSTLOOKING) && issig(FORREAL)) {
1313+
error = SET_ERROR(EINTR);
1314+
break;
1315+
}
1316+
13121317
nbps = maxblocks;
13131318
last_synced_txg = spa_last_synced_txg(dmu_objset_spa(inos));
13141319
error = dmu_read_l0_bps(inos, inzp->z_id, inoff, size, bps,

0 commit comments

Comments
 (0)