From cff1a3e5da18708311dbb5d2fb178a800b031333 Mon Sep 17 00:00:00 2001 From: Owain Ainsworth Date: Thu, 23 Sep 2010 18:43:38 +0000 Subject: In procfs_root(), while the vn_lock on a newly-allocated vnode can not fail it is still good practise to either check the return value or to provide a flag that won't (to avoid copy pasted code that gets it wrong). So change LK_EXCLUSIVE to LK_EXCLUSIVE | LK_RETRY, removing the one caller of vn_lock in the tree that doesn't either pass LK_RETRY or check the return value. ok thib@, jsing@ as part of a larger diff. --- sys/miscfs/procfs/procfs_vfsops.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sys') diff --git a/sys/miscfs/procfs/procfs_vfsops.c b/sys/miscfs/procfs/procfs_vfsops.c index 637786a675e..2325b8a4e17 100644 --- a/sys/miscfs/procfs/procfs_vfsops.c +++ b/sys/miscfs/procfs/procfs_vfsops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: procfs_vfsops.c,v 1.25 2007/06/18 08:30:07 jasper Exp $ */ +/* $OpenBSD: procfs_vfsops.c,v 1.26 2010/09/23 18:43:37 oga Exp $ */ /* $NetBSD: procfs_vfsops.c,v 1.25 1996/02/09 22:40:53 christos Exp $ */ /* @@ -149,7 +149,7 @@ procfs_root(struct mount *mp, struct vnode **vpp) error = procfs_allocvp(mp, vpp, 0, Proot); if (error) return (error); - vn_lock(*vpp, LK_EXCLUSIVE, curproc); + vn_lock(*vpp, LK_EXCLUSIVE | LK_RETRY, curproc); return (0); } -- cgit v1.2.3