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 <behlendorf1@llnl.gov>
Signed-off-by: Pawel Jakub Dawidek <pawel@dawidek.net>
Closes openzfs#16208
  • Loading branch information
pjd authored May 25, 2024
1 parent efbef9e commit 08648cf
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 @@ -1412,6 +1412,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 08648cf

Please sign in to comment.