git: 303d3ae7e841 - main - ufs, msdosfs: do not record witness order when creating vnode
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 01 Feb 2022 09:03:07 UTC
The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=303d3ae7e8419b457078598b8569e57a5e3fb5ce commit 303d3ae7e8419b457078598b8569e57a5e3fb5ce Author: Konstantin Belousov <kib@FreeBSD.org> AuthorDate: 2022-02-01 05:16:30 +0000 Commit: Konstantin Belousov <kib@FreeBSD.org> CommitDate: 2022-02-01 08:51:55 +0000 ufs, msdosfs: do not record witness order when creating vnode When allocating new vnode, we need to lock it exclusively before making it externally visible. Since other threads cannot observe the vnode yet, current lock order cannot create LoR conditions. Reviewed by: mckusick Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D34126 --- sys/fs/msdosfs/msdosfs_denode.c | 2 +- sys/ufs/ffs/ffs_vfsops.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/fs/msdosfs/msdosfs_denode.c b/sys/fs/msdosfs/msdosfs_denode.c index 70b574e48e4b..408c96981481 100644 --- a/sys/fs/msdosfs/msdosfs_denode.c +++ b/sys/fs/msdosfs/msdosfs_denode.c @@ -181,7 +181,7 @@ badoff: ldep->de_diroffset = diroffset; ldep->de_inode = inode; cluster_init_vn(&ldep->de_clusterw); - lockmgr(nvp->v_vnlock, LK_EXCLUSIVE, NULL); + lockmgr(nvp->v_vnlock, LK_EXCLUSIVE | LK_NOWITNESS, NULL); VN_LOCK_AREC(nvp); /* for doscheckpath */ fc_purge(ldep, 0); /* init the FAT cache for this denode */ error = insmntque(nvp, mntp); diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c index 131bdc33f427..a2a361e813e4 100644 --- a/sys/ufs/ffs/ffs_vfsops.c +++ b/sys/ufs/ffs/ffs_vfsops.c @@ -1891,7 +1891,7 @@ ffs_vgetf(mp, ino, flags, vpp, ffs_flags) /* * FFS supports recursive locking. */ - lockmgr(vp->v_vnlock, LK_EXCLUSIVE, NULL); + lockmgr(vp->v_vnlock, LK_EXCLUSIVE | LK_NOWITNESS, NULL); VN_LOCK_AREC(vp); vp->v_data = ip; vp->v_bufobj.bo_bsize = fs->fs_bsize;