diff options
author | Tom Erickson <Tom.Erickson@Sun.COM> | 2010-01-15 13:13:56 -0800 |
---|---|---|
committer | Tom Erickson <Tom.Erickson@Sun.COM> | 2010-01-15 13:13:56 -0800 |
commit | a79992aa86337b5472ea858477dfcdfe49945c80 (patch) | |
tree | efcddcc228ab8d126037f30a8c3cbcdd6066d87e /usr/src/lib/libzfs/common/libzfs_dataset.c | |
parent | 8175704f100a4d28687a2b2df9563d67194962bd (diff) | |
download | illumos-gate-a79992aa86337b5472ea858477dfcdfe49945c80.tar.gz |
6908211 'zfs inherit -S volsize <volume>' core dumps
6909909 memory leak in zfs_receive()
6916662 received mountpoint invalid after upgrade to zpool v22
Diffstat (limited to 'usr/src/lib/libzfs/common/libzfs_dataset.c')
-rw-r--r-- | usr/src/lib/libzfs/common/libzfs_dataset.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/usr/src/lib/libzfs/common/libzfs_dataset.c b/usr/src/lib/libzfs/common/libzfs_dataset.c index 4097e0b340..8549117877 100644 --- a/usr/src/lib/libzfs/common/libzfs_dataset.c +++ b/usr/src/lib/libzfs/common/libzfs_dataset.c @@ -1902,10 +1902,22 @@ zfs_prop_get(zfs_handle_t *zhp, zfs_prop_t prop, char *propbuf, size_t proplen, if (str[0] == '/') { char buf[MAXPATHLEN]; char *root = buf; - const char *relpath = zhp->zfs_name + strlen(source); + const char *relpath; - if (relpath[0] == '/') - relpath++; + /* + * If we inherit the mountpoint, even from a dataset + * with a received value, the source will be the path of + * the dataset we inherit from. If source is + * ZPROP_SOURCE_VAL_RECVD, the received value is not + * inherited. + */ + if (strcmp(source, ZPROP_SOURCE_VAL_RECVD) == 0) { + relpath = ""; + } else { + relpath = zhp->zfs_name + strlen(source); + if (relpath[0] == '/') + relpath++; + } if ((zpool_get_prop(zhp->zpool_hdl, ZPOOL_PROP_ALTROOT, buf, MAXPATHLEN, NULL)) || |