Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/fs/udf VOP_GETATTR() needs a shared lock at least.



details:   https://anonhg.NetBSD.org/src/rev/f5c5a4b3f38d
branches:  trunk
changeset: 770481:f5c5a4b3f38d
user:      hannken <hannken%NetBSD.org@localhost>
date:      Tue Oct 18 20:20:29 2011 +0000

description:
VOP_GETATTR() needs a shared lock at least.

While here fix a typo (fvp -> tvp).

diffstat:

 sys/fs/udf/udf_vnops.c |  8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diffs (35 lines):

diff -r aede04368e37 -r f5c5a4b3f38d sys/fs/udf/udf_vnops.c
--- a/sys/fs/udf/udf_vnops.c    Tue Oct 18 17:59:01 2011 +0000
+++ b/sys/fs/udf/udf_vnops.c    Tue Oct 18 20:20:29 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: udf_vnops.c,v 1.67 2011/09/27 01:33:30 christos Exp $ */
+/* $NetBSD: udf_vnops.c,v 1.68 2011/10/18 20:20:29 hannken Exp $ */
 
 /*
  * Copyright (c) 2006, 2008 Reinoud Zandijk
@@ -32,7 +32,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__KERNEL_RCSID(0, "$NetBSD: udf_vnops.c,v 1.67 2011/09/27 01:33:30 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: udf_vnops.c,v 1.68 2011/10/18 20:20:29 hannken Exp $");
 #endif /* not lint */
 
 
@@ -1978,13 +1978,15 @@
        }
 
        /* get info about the node to be moved */
+       vn_lock(fvp, LK_SHARED | LK_RETRY);
        error = VOP_GETATTR(fvp, &fvap, FSCRED);
+       VOP_UNLOCK(fvp);
        KASSERT(error == 0);
 
        /* check when to delete the old already existing entry */
        if (tvp) {
                /* get info about the node to be moved to */
-               error = VOP_GETATTR(fvp, &tvap, FSCRED);
+               error = VOP_GETATTR(tvp, &tvap, FSCRED);
                KASSERT(error == 0);
 
                /* if both dirs, make sure the destination is empty */



Home | Main Index | Thread Index | Old Index