Date: Wed, 10 Aug 2011 19:10:13 GMT From: Martin Matuska <mm@FreeBSD.org> To: freebsd-fs@FreeBSD.org Subject: Re: kern/157728: [zfs] zfs (v28) incremental receive may leave behind temporary clones Message-ID: <201108101910.p7AJADsn070367@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR kern/157728; it has been noted by GNATS. From: Martin Matuska <mm@FreeBSD.org> To: bug-followup@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--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201108101910.p7AJADsn070367>