From cc82ff1c96223f9d8d704c1d74933c88c7538c22 Mon Sep 17 00:00:00 2001 From: Martin Matuska Date: Sat, 13 Aug 2011 10:58:53 +0000 Subject: [PATCH] Fix race between dmu_objset_prefetch() invoked from zfs_ioc_dataset_list_next() and dsl_dir_destroy_check() indirectly invoked from dmu_recv_existing_end() via dsl_dataset_destroy() by not prefetching temporary clones, as these count as always inconsistent. In addition, do not prefetch hidden datasets at all as we are not going to process these later. Filed as Illumos Bug #1346 PR: kern/157728 Tested by: Borja Marcos , mm Reviewed by: pjd Approved by: re (kib) MFC after: 1 week --- sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c index ff5d40e9cb19..dbaa2777d543 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c @@ -1964,7 +1964,8 @@ zfs_ioc_dataset_list_next(zfs_cmd_t *zc) int len = sizeof (zc->zc_name) - (p - zc->zc_name); while (dmu_dir_list_next(os, len, p, NULL, &cookie) == 0) - (void) dmu_objset_prefetch(zc->zc_name, NULL); + if (dataset_name_hidden(zc->zc_name) == B_FALSE) + (void) dmu_objset_prefetch(zc->zc_name, NULL); } do {