libbe: pull props for the correct dataset in be_mounted_at()

The props feature to this API was added as a "just in case", with no
planned consumer.  It turns out that it was implemented incorrectly,
tapping out props for the BE root (BE's parent) rather than the BE
itself in all cases.

Fetch properties for the dataset that's actually mounted at the queried
path.

Reported by:	Christian McDonald <cmcdonald netgate com>
MFC after:	3 days
This commit is contained in:
Kyle Evans 2022-03-31 14:19:52 -05:00
parent d155d8e138
commit 31190aa02e

View File

@ -210,7 +210,7 @@ be_mounted_at(libbe_handle_t *lbh, const char *path, nvlist_t *details)
if (info.name != NULL) {
if (details != NULL) {
if ((root_hdl = zfs_open(lbh->lzh, lbh->root,
if ((root_hdl = zfs_open(lbh->lzh, info.name,
ZFS_TYPE_FILESYSTEM)) == NULL) {
free(info.name);
return (BE_ERR_ZFSOPEN);