From 3fd3e56cfd543d7d7a1bf502bfc0db6e24139668 Mon Sep 17 00:00:00 2001 From: LOLi Date: Mon, 25 Sep 2017 19:32:34 +0200 Subject: Fix some ZFS Test Suite issues * Add 'zfs bookmark' coverage (zfs_bookmark_cliargs) * Add OpenZFS 8166 coverage (zpool_scrub_offline_device) * Fix "busy" zfs_mount_remount failures * Fix bootfs_003_pos, bootfs_004_neg, zdb_005_pos local cleanup * Update usage of $KEEP variable, add get_all_pools() function * Enable history_008_pos and rsend_019_pos (non-32bit builders) * Enable zfs_copies_005_neg, update local cleanup * Fix zfs_send_007_pos (large_dnode + OpenZFS 8199) * Fix rollback_003_pos (use dataset name, not mountpoint, to unmount) * Update default_raidz_setup() to work properly with more than 3 disks * Use $TEST_BASE_DIR instead of hardcoded (/var)/tmp for file VDEVs * Update usage of /dev/random to /dev/urandom Reviewed-by: Brian Behlendorf Signed-off-by: loli10K Issue #6086 Closes #5658 Closes #6143 Closes #6421 Closes #6627 Closes #6632 --- lib/libzfs/libzfs_mount.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lib/libzfs/libzfs_mount.c') diff --git a/lib/libzfs/libzfs_mount.c b/lib/libzfs/libzfs_mount.c index b2d082e17..59b98a284 100644 --- a/lib/libzfs/libzfs_mount.c +++ b/lib/libzfs/libzfs_mount.c @@ -136,6 +136,10 @@ is_shared(libzfs_handle_t *hdl, const char *mountpoint, zfs_share_proto_t proto) if (hdl->libzfs_sharetab == NULL) return (SHARED_NOT_SHARED); + /* Reopen ZFS_SHARETAB to prevent reading stale data from open file */ + if (freopen(ZFS_SHARETAB, "r", hdl->libzfs_sharetab) == NULL) + return (SHARED_NOT_SHARED); + (void) fseek(hdl->libzfs_sharetab, 0, SEEK_SET); while (fgets(buf, sizeof (buf), hdl->libzfs_sharetab) != NULL) { @@ -660,7 +664,7 @@ zfs_unmount(zfs_handle_t *zhp, const char *mountpoint, int flags) * then get freed later. We strdup it to play it safe. */ if (mountpoint == NULL) - mntpt = zfs_strdup(hdl, entry.mnt_mountp); + mntpt = zfs_strdup(hdl, entry.mnt_special); else mntpt = zfs_strdup(hdl, mountpoint); -- cgit v1.2.3