Skip to content

Commit e5e4957

Browse files
pjdtonyhutter
authored andcommitted
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). Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Pawel Jakub Dawidek <[email protected]> Closes openzfs#16208
1 parent ca95fa3 commit e5e4957

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
@@ -1418,6 +1418,11 @@ zfs_clone_range(znode_t *inzp, uint64_t *inoffp, znode_t *outzp,
14181418
outoff += size;
14191419
len -= size;
14201420
done += size;
1421+
1422+
if (issig(JUSTLOOKING) && issig(FORREAL)) {
1423+
error = SET_ERROR(EINTR);
1424+
break;
1425+
}
14211426
}
14221427

14231428
vmem_free(bps, sizeof (bps[0]) * maxblocks);

0 commit comments

Comments
 (0)