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: Manuel Bouyer <bouyer%antioche.eu.org@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: kern-bug-people%NetBSD.org@localhost, gnats-admin%NetBSD.org@localhost, 
netbsd-bugs%NetBSD.org@localhost,
        tron%zhadum.org.uk@localhost
Subject: Re: kern/46221: Kernel panic in NFS server code
Date: Wed, 21 Mar 2012 16:49:08 +0100

 On Wed, Mar 21, 2012 at 03:10:10PM +0000, Matthias Scheler wrote:
 > The following reply was made to PR kern/46221; it has been noted by GNATS.
 > 
 > From: Matthias Scheler <tron%zhadum.org.uk@localhost>
 > To: "J. Hannken-Illjes" <hannken%eis.cs.tu-bs.de@localhost>
 > Cc: NetBSD GNATS <gnats-bugs%NetBSD.org@localhost>
 > Subject: Re: kern/46221: Kernel panic in NFS server code
 > Date: Wed, 21 Mar 2012 15:08:27 +0000
 > 
 >  On Wed, Mar 21, 2012 at 03:44:28PM +0100, J. Hannken-Illjes wrote:
 >  > <snip>
 >  > > 
 >  > > Manual Bouyer has looked at this crash. The kernel paniced here:
 >  > > 
 >  > >         ip = VTOI(nvp);
 >  > > -->     if (ip->i_mode == 0 || ip->i_gen != ufhp->ufid_gen) {
 >  > >                 vput(nvp);
 >  > >                 *vpp = NULLVP;
 >  > >                 return (ESTALE);
 >  > >         }
 >  > > 
 >  > > I guess that an extra check whether "ip" is NULL would prevent the
 >  > > panic. But I'm not sure whether that is the correct fix.
 >  > 
 >  > Please change this to
 >  > 
 >  >   ip = VTOI(nvp);
 >  > + if (ip == NULL) {
 >  > +         vprintf("NULL IP", nvp);
 >  > +         panic("NULL IP");
 >  > + }
 >  >   if (...
 >  > 
 >  > so on the next crash we know more about the state of the vnode/inode.
 >  
 >  I've already changed it like this:
 >  
 >  Index: sys/ufs/ufs/ufs_vfsops.c
 >  ===================================================================
 >  RCS file: /cvsroot/src/sys/ufs/ufs/ufs_vfsops.c,v
 >  retrieving revision 1.50
 >  diff -u -r1.50 ufs_vfsops.c
 >  --- sys/ufs/ufs/ufs_vfsops.c        1 Feb 2012 05:34:43 -0000       1.50
 >  +++ sys/ufs/ufs/ufs_vfsops.c        21 Mar 2012 15:07:49 -0000
 >  @@ -223,7 +223,11 @@
 >              return (error);
 >      }
 >      ip = VTOI(nvp);
 >  -   if (ip->i_mode == 0 || ip->i_gen != ufhp->ufid_gen) {
 >  +   if (ip == NULL || ip->i_mode == 0 || ip->i_gen != ufhp->ufid_gen) {
 >  +           if (ip == NULL) {
 >  +                   aprint_normal("ufs_fhtovp: ip == NULL on vp %p\n",
 >  +                       nvp);
 >  +           }
 >              vput(nvp);
 >              *vpp = NULLVP;
 >              return (ESTALE);
 >  
 >  I'll check whether I get some of these kernel messages.
 >  
 >  > If you are able to debug the core dump you could `print *nvp' here.
 >  
 >  Kernel core dumps have never worked for me under NetBSD/amd64.
 
 But I think, once you have the vnode address, you can do a
 show vnode <addr>
 from ddb.
 
 -- 
 Manuel Bouyer <bouyer%antioche.eu.org@localhost>
      NetBSD: 26 ans d'experience feront toujours la difference
 --
 


Home | Main Index | Thread Index | Old Index