From b53cb02d925258ada06282d7dc4223a251edb5cb Mon Sep 17 00:00:00 2001 From: loli10K Date: Wed, 5 Dec 2018 18:33:52 +0100 Subject: [PATCH] Fix 'zfs receive -F' message when destination has snapshots When receiving a send stream with forced rollback on a dataset with snapshots zfs suggests said snapshots must be removed to successfully receive the stream; however the message is misleading because it prints the dataset name instead of one of its snapshots. $ sudo zfs snap pp/recvfs@snap-orig $ sudo zfs recv -F pp/recvfs < sendstream cannot receive new filesystem stream: destination has snapshots (eg. pp/recvfs) must destroy them to overwrite it This change simply restores the snapshot name in the error message. Reviewed-by: George Melikov Reviewed-by: Brian Behlendorf Signed-off-by: loli10K Closes #8167 --- lib/libzfs/libzfs_sendrecv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libzfs/libzfs_sendrecv.c b/lib/libzfs/libzfs_sendrecv.c index 710bc1912..a05ccbe30 100644 --- a/lib/libzfs/libzfs_sendrecv.c +++ b/lib/libzfs/libzfs_sendrecv.c @@ -3930,7 +3930,7 @@ zfs_receive_one(libzfs_handle_t *hdl, int infd, const char *tosnap, zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, "destination has snapshots (eg. %s)\n" "must destroy them to overwrite it"), - name); + zc.zc_name); err = zfs_error(hdl, EZFS_EXISTS, errbuf); goto out; } -- 2.40.0