Skip to content

Commit dca2a6a

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 dca2a6a

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
@@ -1412,6 +1412,11 @@ zfs_clone_range(znode_t *inzp, uint64_t *inoffp, znode_t *outzp,
14121412
outoff += size;
14131413
len -= size;
14141414
done += size;
1415+
1416+
if (issig(JUSTLOOKING) && issig(FORREAL)) {
1417+
error = SET_ERROR(EINTR);
1418+
break;
1419+
}
14151420
}
14161421

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

0 commit comments

Comments
 (0)