NetBSD-Bugs archive

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

kern/45571: lfs_vnops.c: redundant unlock and lock



>Number:         45571
>Category:       kern
>Synopsis:       lfs_vnops.c: redundant unlock and lock
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Nov 05 13:40:04 +0000 2011
>Originator:     NAKAJIMA Yoshihiro
>Release:        NetBSD-current/20111104
>Organization:
>Environment:
System: NetBSD asura 5.99.56 NetBSD 5.99.56 (ASURA) #5: Fri Nov 4 21:22:11 JST 
2011 nakayosh@asura:/usr/src/sys/arch/amd64/compile/ASURA amd64
Architecture: x86_64
Machine: amd64
>Description:
        There are redundant unlock and lock in lfs_vnops.c.
        I think they should be removed in 1.204 or 1.208.
>How-To-Repeat:
>Fix:
Date: Sat Nov  5 22:33:48 JST 2011
diff -u src/sys/ufs/lfs/lfs_vnops.c.ORIG src/sys/ufs/lfs/lfs_vnops.c
--- src/sys/ufs/lfs/lfs_vnops.c.ORIG    2011-09-20 23:01:33.000000000 +0900
+++ src/sys/ufs/lfs/lfs_vnops.c 2011-11-05 22:30:42.000000000 +0900
@@ -1,4 +1,4 @@
-/*     $NetBSD: lfs_vnops.c,v 1.238 2011/09/20 14:01:33 chs Exp $      */
+/*     $NetBSD$        */
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2002, 2003 The NetBSD Foundation, Inc.
@@ -2315,9 +2315,6 @@
                busypg = NULL;
                if (check_dirty(fs, vp, startoffset, endoffset, blkeof,
                                ap->a_flags, 0, &busypg) < 0) {
-                       mutex_exit(vp->v_interlock);
-
-                       mutex_enter(vp->v_interlock);
                        write_and_wait(fs, vp, busypg, seglocked, NULL);
                        if (!seglocked) {
                                mutex_exit(vp->v_interlock);



Home | Main Index | Thread Index | Old Index