lsof on 6.0

Danny Braniss danny at cs.huji.ac.il
Fri Dec 23 00:25:04 PST 2005


> On Thursday 22 December 2005 16:27, Danny Braniss wrote:
> 
> > > > > Do you have a mount which is a symlink?
> > > >
> > > > no, but many nfs.
> > > > minbari> mount
> > > > 132.65.16.100:/d/6 on / (nfs)
> 
> > Breakpoint 1 at 0x402779: file dmnt.c, line 159.
> > (gdb) run
> > Starting program:
> > /home/pobj/r+d/ports/sysutils/lsof/work/lsof_4.77A.freebsd/ls of
> > lsof: WARNING: access /root/.lsof_shuttle-3: No such file or directory
> > lsof: WARNING: can't open /root/.lsof_shuttle-3: Read-only file system
> >
> > Breakpoint 1, dev2udev (c=0xe) at dmnt.c:159
> > 159                 if (ln != dn)
> > (gdb)  print sr
> > $1 = -1
> > (gdb)  print ln
> > $2 = 0x525140 "132.65.16.100:/d/8"
> > (gdb) print dn
> > $3 = 0x525140 "132.65.16.100:/d/8"
> 
> As I figured, statsafely (which wraps around stat(2)) returns -1 on your nfs 
> mount, therefore ss never gets set. I've got no idea what the "user device 
> random seed" is needed for, so I suggest you file a pr with the above info.
> 
> Additionally, you can try the following patch to see why exactly the stat(2) 
> call fails:
> --- dmnt.c.orig Mon Oct  3 15:22:52 2005
> +++ dmnt.c      Thu Dec 22 16:51:23 2005
> @@ -163,6 +163,9 @@
>             dn = (char *)NULL;
>             if (sr)
>                 continue;
> +           else
> +               (void)fprintf(stderr, "%s: cannot stat %s: %s\n", Pn, ln, 
> strerror(errno));
> +
>             ss = 1;
>             s = (u_int)sb.st_ino ^ (u_int)sb.st_rdev;
>             break;
> 

well, your patch has problems, but at least it pointed in the direction :-)

/ (root) is nfs mounted.

the problem is in process_node(va) in dnode.c, that sets vtag to VT_UFS 
instead of VT_NFS because
vtbuf is "ufs" after a call to kread((KA_T)v->v_tag...

so, can someone with some more knowledge in vnodes follow this? I suspect the 
problem is in the kernel ...

danny





More information about the freebsd-stable mailing list