kern/157728: [zfs] zfs (v28) incremental receive may leave
behind temporary clones
Martin Matuska
mm at FreeBSD.org
Wed Aug 10 19:10:13 UTC 2011
The following reply was made to PR kern/157728; it has been noted by GNATS.
From: Martin Matuska <mm at FreeBSD.org>
To: bug-followup at FreeBSD.org
Cc:
Subject: Re: kern/157728: [zfs] zfs (v28) incremental receive may leave behind
temporary clones
Date: Wed, 10 Aug 2011 21:08:36 +0200
This is a multi-part message in MIME format.
--------------020705050701020904030304
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
I have now an alternative patch (does almost the same, but at different
place).
--
Martin Matuska
FreeBSD committer
http://blog.vx.sk
--------------020705050701020904030304
Content-Type: text/plain;
name="dmu_objset.c.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="dmu_objset.c.patch"
Index: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c
===================================================================
--- sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c (revision 224760)
+++ sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c (working copy)
@@ -1760,10 +1760,29 @@
dmu_objset_prefetch(const char *name, void *arg)
{
dsl_dataset_t *ds;
+ char *cp;
+ /*
+ * If the objset starts with a '%', then ignore it.
+ * These hidden datasets are always inconsistent and by not opening
+ * them here, we can avoid a race with dsl_dir_destroy_check().
+ */
+ cp = strrchr(name, '/');
+ if (cp && cp[1] == '%')
+ return (0);
+
if (dsl_dataset_hold(name, FTAG, &ds))
return (0);
+ /*
+ * If the objset is in an inconsistent state (eg, in the process
+ * of being destroyed), don't prefetch it.
+ */
+ if (ds->ds_phys->ds_flags & DS_FLAG_INCONSISTENT) {
+ dsl_dataset_rele(ds, FTAG);
+ return (0);
+ }
+
if (!BP_IS_HOLE(&ds->ds_phys->ds_bp)) {
mutex_enter(&ds->ds_opening_lock);
if (ds->ds_objset == NULL) {
--------------020705050701020904030304--
More information about the freebsd-fs
mailing list