diff options
author | pjd <pjd@FreeBSD.org> | 2009-09-08 08:54:15 +0000 |
---|---|---|
committer | pjd <pjd@FreeBSD.org> | 2009-09-08 08:54:15 +0000 |
commit | 7faac77b19969bf72936ce583b2ee0d892ce7c7b (patch) | |
tree | b93754526db2b76d7414290904ab89e41ab2d062 | |
parent | 676cac231c069842bf50a04b5c1ebb4bbdf57d53 (diff) | |
download | FreeBSD-src-7faac77b19969bf72936ce583b2ee0d892ce7c7b.zip FreeBSD-src-7faac77b19969bf72936ce583b2ee0d892ce7c7b.tar.gz |
Fix reference count leak for a case where snapshot's mount point is updated.
Such situation is not supported.
This problem was triggered by something like this:
# zpool create tank da0
# zfs snapshot tank@snap
# cd /tank/.zfs/snapshot/snap (this will mount the snapshot)
# cd
# mount -u nosuid /tank/.zfs/snapshot/snap (refcount leak)
# zpool export tank
cannot export 'tank': pool is busy
MFC after: 1 week
-rw-r--r-- | sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c index 27e9c81..f5295aa 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c @@ -337,6 +337,13 @@ zfs_register_callbacks(vfs_t *vfsp) os = zfsvfs->z_os; /* + * This function can be called for a snapshot when we update snapshot's + * mount point, which isn't really supported. + */ + if (dmu_objset_is_snapshot(os)) + return (EOPNOTSUPP); + + /* * The act of registering our callbacks will destroy any mount * options we may have. In order to enable temporary overrides * of mount options, we stash away the current values and |