NetBSD-Bugs archive

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

Re: kern/46221: Kernel panic in NFS server code



The following reply was made to PR kern/46221; it has been noted by GNATS.

From: "J. Hannken-Illjes" <hannken%eis.cs.tu-bs.de@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: Matthias Scheler <tron%zhadum.org.uk@localhost>
Subject: Re: kern/46221: Kernel panic in NFS server code
Date: Fri, 23 Mar 2012 10:03:40 +0100

 Please try the attached diff that changes vn_lock() to return an invalid
 vnode only if the caller requested it by setting LK_RETRY.
 
 --
 Juergen Hannken-Illjes - hannken%eis.cs.tu-bs.de@localhost - TU Braunschweig 
(Germany)
 
 Index: vfs_vnops.c
 ===================================================================
 RCS file: /cvsroot/src/sys/kern/vfs_vnops.c,v
 retrieving revision 1.183
 diff -p -u -4 -r1.183 vfs_vnops.c
 --- vfs_vnops.c        14 Oct 2011 09:23:31 -0000      1.183
 +++ vfs_vnops.c        23 Mar 2012 08:59:24 -0000
 @@ -804,8 +804,17 @@ vn_lock(struct vnode *vp, int flags)
                        error = ENOENT;
                } else {
                        mutex_exit(vp->v_interlock);
                        error = VOP_LOCK(vp, (flags & ~LK_RETRY));
 +                      if (error == 0 && (flags & LK_RETRY) == 0) {
 +                              mutex_enter(vp->v_interlock);
 +                              if ((vp->v_iflag & VI_CLEAN)) {
 +                                      mutex_exit(vp->v_interlock);
 +                                      VOP_UNLOCK(vp);
 +                                      return ENOENT;
 +                              }
 +                              mutex_exit(vp->v_interlock);
 +                      }
                        if (error == 0 || error == EDEADLK || error == EBUSY)
                                return (error);
                }
        } while (flags & LK_RETRY);
 


Home | Main Index | Thread Index | Old Index