Skip to content

Commit

Permalink
Ignore error while trying to enable smb share
Browse files Browse the repository at this point in the history
Signed-off-by: Umer Saleem <[email protected]>
  • Loading branch information
usaleem-ix committed Aug 15, 2023
1 parent b2e707c commit 152138d
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions lib/libzfs/libzfs_mount.c
Original file line number Diff line number Diff line change
Expand Up @@ -738,10 +738,23 @@ zfs_share(zfs_handle_t *zhp, const enum sa_protocol *proto)
err = sa_enable_share(zfs_get_name(zhp), mountpoint, shareopts,
*curr_proto);
if (err != SA_OK) {
return (zfs_error_fmt(zhp->zfs_hdl,
proto_table[*curr_proto].p_share_err,
dgettext(TEXT_DOMAIN, "cannot share '%s: %s'"),
zfs_get_name(zhp), sa_errorstr(err)));
/*
* For TrueNAS, ignore the error encountered while trying

Check failure on line 742 in lib/libzfs/libzfs_mount.c

View workflow job for this annotation

GitHub Actions / checkstyle

line > 80 characters
* to enable the SMB share. We rely on middleware to share

Check failure on line 743 in lib/libzfs/libzfs_mount.c

View workflow job for this annotation

GitHub Actions / checkstyle

line > 80 characters
* the filesystem over SMB. Due to difference in user
* shares path, returning the error from here leads to
* pool import failure.
*/
if (proto_table[*curr_proto].p_prop == ZFS_PROP_SHARESMB)

Check failure on line 748 in lib/libzfs/libzfs_mount.c

View workflow job for this annotation

GitHub Actions / checkstyle

line > 80 characters
zfs_error_fmt(zhp->zfs_hdl,
proto_table[*curr_proto].p_share_err,
dgettext(TEXT_DOMAIN, "cannot share '%s: %s'"),

Check failure on line 751 in lib/libzfs/libzfs_mount.c

View workflow job for this annotation

GitHub Actions / checkstyle

line > 80 characters
zfs_get_name(zhp), sa_errorstr(err));
else
return (zfs_error_fmt(zhp->zfs_hdl,
proto_table[*curr_proto].p_share_err,
dgettext(TEXT_DOMAIN, "cannot share '%s: %s'"),

Check failure on line 756 in lib/libzfs/libzfs_mount.c

View workflow job for this annotation

GitHub Actions / checkstyle

line > 80 characters
zfs_get_name(zhp), sa_errorstr(err)));
}

}
Expand Down

0 comments on commit 152138d

Please sign in to comment.