mirror of
https://github.com/freebsd/freebsd-src.git
synced 2026-10-28 19:34:43 +01:00
Make mount/share errors non-fatal for zfs create/clone
If zfs_mount_and_share() fails, the error propagates to zfs create/clone commands despite successful operation. If create/clone operations were successful, there's no point in making zfs_mount_and_share() failures fatal. Signed-off-by: Ameer Hamza <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Alexander Motin <[email protected]> Closes #17799
This commit is contained in:
1 parent
cb3c18a9a9
commit
ac2d8c80b6
1 file changed
+8
-2
+8
-2
@@ -914,7 +914,11 @@ zfs_do_clone(int argc, char **argv)
|
||||
log_history = B_FALSE;
|
||||
}
|
||||
|
||||
ret = zfs_mount_and_share(g_zfs, argv[1], ZFS_TYPE_DATASET);
|
||||
/*
|
||||
* Dataset cloned successfully, mount/share failures are
|
||||
* non-fatal.
|
||||
*/
|
||||
(void) zfs_mount_and_share(g_zfs, argv[1], ZFS_TYPE_DATASET);
|
||||
}
|
||||
|
||||
zfs_close(zhp);
|
||||
@@ -1333,7 +1337,9 @@ zfs_do_create(int argc, char **argv)
|
||||
goto error;
|
||||
}
|
||||
|
||||
ret = zfs_mount_and_share(g_zfs, argv[0], ZFS_TYPE_DATASET);
|
||||
/* Dataset created successfully, mount/share failures are non-fatal */
|
||||
ret = 0;
|
||||
(void) zfs_mount_and_share(g_zfs, argv[0], ZFS_TYPE_DATASET);
|
||||
error:
|
||||
nvlist_free(props);
|
||||
return (ret);
|
||||
|
||||
Reference in new issue
Block a user