aboutsummaryrefslogtreecommitdiff
path: root/sys/fs/nullfs/null.h
diff options
context:
space:
mode:
authorKonstantin Belousov <kib@FreeBSD.org>2013-05-11 11:17:44 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2013-05-11 11:17:44 +0000
commit0fc6daa72d3513dbb7c5699a3eb9cee69ef4bd23 (patch)
treeeec4ec06bf51508293c37264e9b64bf402c90040 /sys/fs/nullfs/null.h
parent5d81d095984217862ae54463fa16a209cdde6998 (diff)
downloadsrc-0fc6daa72d3513dbb7c5699a3eb9cee69ef4bd23.tar.gz
src-0fc6daa72d3513dbb7c5699a3eb9cee69ef4bd23.zip
- Fix nullfs vnode reference leak in nullfs_reclaim_lowervp(). The
null_hashget() obtains the reference on the nullfs vnode, which must be dropped. - Fix a wart which existed from the introduction of the nullfs caching, do not unlock lower vnode in the nullfs_reclaim_lowervp(). It should be innocent, but now it is also formally safe. Inform the nullfs_reclaim() about this using the NULLV_NOUNLOCK flag set on nullfs inode. - Add a callback to the upper filesystems for the lower vnode unlinking. When inactivating a nullfs vnode, check if the lower vnode was unlinked, indicated by nullfs flag NULLV_DROP or VV_NOSYNC on the lower vnode, and reclaim upper vnode if so. This allows nullfs to purge cached vnodes for the unlinked lower vnode, avoiding excessive caching. Reported by: G??ran L??wkrantz <goran.lowkrantz@ismobile.com> Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks
Notes
Notes: svn path=/head/; revision=250505
Diffstat (limited to 'sys/fs/nullfs/null.h')
-rw-r--r--sys/fs/nullfs/null.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/fs/nullfs/null.h b/sys/fs/nullfs/null.h
index 4f37020d6da5..0972dfc409c3 100644
--- a/sys/fs/nullfs/null.h
+++ b/sys/fs/nullfs/null.h
@@ -53,8 +53,12 @@ struct null_node {
LIST_ENTRY(null_node) null_hash; /* Hash list */
struct vnode *null_lowervp; /* VREFed once */
struct vnode *null_vnode; /* Back pointer */
+ u_int null_flags;
};
+#define NULLV_NOUNLOCK 0x0001
+#define NULLV_DROP 0x0002
+
#define MOUNTTONULLMOUNT(mp) ((struct null_mount *)((mp)->mnt_data))
#define VTONULL(vp) ((struct null_node *)(vp)->v_data)
#define NULLTOV(xp) ((xp)->null_vnode)