Skip to content

Commit

Permalink
DLPX-66733 zfs share -g should ignore ZFS_CANMOUNT_NOAUTO (openzfs#109)
Browse files Browse the repository at this point in the history
The zfs share -g command will skip nfs exports that have their canmount property set to noauto but otherwise have a valid mountpoint. For NPM filesystems the canmount and sync properties are overridden. This causes the zfs-share service to drop their exports.
  • Loading branch information
Don Brady authored and Bryant G. Ly committed Dec 9, 2019
1 parent 39603ae commit 1deddec
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions cmd/zfs/zfs_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -6357,10 +6357,21 @@ share_mount_one(zfs_handle_t *zhp, int op, int flags, char *protocol,
"'canmount' property is set to 'off'\n"), cmdname,
zfs_get_name(zhp));
return (1);
} else if (canmount == ZFS_CANMOUNT_NOAUTO && !explicit) {
return (0);
} else if (canmount == ZFS_CANMOUNT_NOAUTO) {
/*
* Skip this request when noauto is set and we wanted all
* mounts|shares (i.e. -a) or we're not generating exports
*/
if (!explicit && !generate)
return (0);
}

/*
* When generating shares and the filesystem isn't mounted then skip it
*/
if (generate && !zfs_is_mounted(zhp, NULL))
return (0);

/*
* If this filesystem is encrypted and does not have
* a loaded key, we can not mount it.
Expand Down

0 comments on commit 1deddec

Please sign in to comment.