git: 5af1131de7fc - main - struct mount uppers: correct locking annotations

Konstantin Belousov kib at FreeBSD.org
Thu Apr 8 22:06:46 UTC 2021


The branch main has been updated by kib:

URL: https://cgit.FreeBSD.org/src/commit/?id=5af1131de7fc18c795ed28e69d9393f78875d3e5

commit 5af1131de7fc18c795ed28e69d9393f78875d3e5
Author:     Konstantin Belousov <kib at FreeBSD.org>
AuthorDate: 2021-04-08 22:03:06 +0000
Commit:     Konstantin Belousov <kib at FreeBSD.org>
CommitDate: 2021-04-08 22:06:26 +0000

    struct mount uppers: correct locking annotations
    
    It is all locked by the uppers' interlock.
    
    Noted by:       Alexander Lochmann <alexander.lochmann at tu-dortmund.de>
    Sponsored by:   The FreeBSD Foundation
    MFC after:      3 days
---
 sys/sys/mount.h | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/sys/sys/mount.h b/sys/sys/mount.h
index 630cd521fbd0..a6d750a1ff37 100644
--- a/sys/sys/mount.h
+++ b/sys/sys/mount.h
@@ -198,6 +198,7 @@ _Static_assert(sizeof(struct mount_pcpu) == 16,
  * 	l - mnt_listmtx
  *	m - mountlist_mtx
  *	i - interlock
+ *	i* - interlock of uppers' list head
  *	v - vnode freelist mutex
  *
  * Unmarked fields are considered stable as long as a ref is held.
@@ -242,8 +243,8 @@ struct mount {
 	struct vnodelst	mnt_lazyvnodelist;	/* (l) list of lazy vnodes */
 	int		mnt_lazyvnodelistsize;	/* (l) # of lazy vnodes */
 	struct lock	mnt_explock;		/* vfs_export walkers lock */
-	TAILQ_ENTRY(mount) mnt_upper_link;	/* (m) we in the all uppers */
-	TAILQ_HEAD(, mount) mnt_uppers;		/* (m) upper mounts over us*/
+	TAILQ_ENTRY(mount) mnt_upper_link;	/* (i*) we in the all uppers */
+	TAILQ_HEAD(, mount) mnt_uppers;		/* (i) upper mounts over us */
 };
 #endif	/* _WANT_MOUNT || _KERNEL */
 


More information about the dev-commits-src-all mailing list