Skip to content

Commit

Permalink
Allow block cloning to be interrupted by a signal.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
pjd authored and tonyhutter committed Nov 14, 2024
1 parent ca95fa3 commit e5e4957
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions module/zfs/zfs_vnops.c
Original file line number Diff line number Diff line change
Expand Up @@ -1418,6 +1418,11 @@ zfs_clone_range(znode_t *inzp, uint64_t *inoffp, znode_t *outzp,
outoff += size;
len -= size;
done += size;

if (issig(JUSTLOOKING) && issig(FORREAL)) {
error = SET_ERROR(EINTR);
break;
}
}

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

0 comments on commit e5e4957

Please sign in to comment.