Date: Sat, 30 Aug 1997 19:42:29 -0400 (EDT) From: Serge Pashenkov <serge@jbj.org> To: freebsd-fs@freebsd.org Subject: NFS panic whith stale file handle Message-ID: <199708302342.TAA01102@serge.jbj.org>
next in thread | raw e-mail | index | archive | help
Hi,
Haven't found NFS mailing list, so using this one, hope it's
OK. Please tell me where it should go if this is a wrong place.
My FreeBSD 2.2-STABLE machine panics while doing df if one of the NFS
mount points became stale. Panic happens in nfs_statfs on the line
marked <===============, where sfp is NULL. I'm not sure how it could
get there with NULL value, but I'm not very good at nfsm_ macros.
int
nfs_statfs(mp, sbp, p)
struct mount *mp;
register struct statfs *sbp;
struct proc *p;
{
register struct vnode *vp;
register struct nfs_statfs *sfp;
register caddr_t cp;
register u_long *tl;
register long t1, t2;
caddr_t bpos, dpos, cp2;
struct nfsmount *nmp = VFSTONFS(mp);
int error = 0, v3 = (nmp->nm_flag & NFSMNT_NFSV3), retattr;
struct mbuf *mreq, *mrep, *md, *mb, *mb2;
struct ucred *cred;
struct nfsnode *np;
u_quad_t tquad;
#ifndef nolint
sfp = (struct nfs_statfs *)0;
#endif
error = nfs_nget(mp, (nfsfh_t *)nmp->nm_fh, nmp->nm_fhsize, &np);
if (error)
return (error);
vp = NFSTOV(np);
cred = crget();
cred->cr_ngroups = 1;
if (v3 && (nmp->nm_flag & NFSMNT_GOTFSINFO) == 0)
(void)nfs_fsinfo(nmp, vp, cred, p);
nfsstats.rpccnt[NFSPROC_FSSTAT]++;
nfsm_reqhead(vp, NFSPROC_FSSTAT, NFSX_FH(v3));
nfsm_fhtom(vp, v3);
nfsm_request(vp, NFSPROC_FSSTAT, p, cred);
if (v3)
nfsm_postop_attr(vp, retattr);
if (!error)
nfsm_dissect(sfp, struct nfs_statfs *, NFSX_STATFS(v3));
#ifdef __NetBSD__
#ifdef COMPAT_09
sbp->f_type = 2;
#else
sbp->f_type = 0;
#endif
#else
sbp->f_type = MOUNT_NFS;
#endif
sbp->f_flags = nmp->nm_flag;
sbp->f_iosize = nfs_iosize(nmp);
if (v3) {
sbp->f_bsize = NFS_FABLKSIZE;
fxdr_hyper(&sfp->sf_tbytes, &tquad); <===============
sbp->f_blocks = (long)(tquad / ((u_quad_t)NFS_FABLKSIZE));
fxdr_hyper(&sfp->sf_fbytes, &tquad);
sbp->f_bfree = (long)(tquad / ((u_quad_t)NFS_FABLKSIZE));
fxdr_hyper(&sfp->sf_abytes, &tquad);
sbp->f_bavail = (long)(tquad / ((u_quad_t)NFS_FABLKSIZE));
sbp->f_files = (fxdr_unsigned(long, sfp->sf_tfiles.nfsuquad[1])
& 0x7fffffff);
sbp->f_ffree = (fxdr_unsigned(long, sfp->sf_ffiles.nfsuquad[1])
& 0x7fffffff);
} else {
sbp->f_bsize = fxdr_unsigned(long, sfp->sf_bsize);
sbp->f_blocks = fxdr_unsigned(long, sfp->sf_blocks);
sbp->f_bfree = fxdr_unsigned(long, sfp->sf_bfree);
sbp->f_bavail = fxdr_unsigned(long, sfp->sf_bavail);
sbp->f_files = 0;
sbp->f_ffree = 0;
}
if (sbp != &mp->mnt_stat) {
bcopy(mp->mnt_stat.f_mntonname, sbp->f_mntonname, MNAMELEN);
bcopy(mp->mnt_stat.f_mntfromname, sbp->f_mntfromname, MNAMELEN);
}
nfsm_reqdone;
vput(vp);
crfree(cred);
return (error);
}
Here is snoop output on the NFS exchange between the machines, which
seems pretty normal to me:
NFS: ----- Sun NFS -----
NFS:
NFS: Proc = 19 (Get filesystem information)
NFS: File handle = 0080001600000002000A000000000002
NFS: 737B83D0
NFS:
NFS: ----- Sun NFS -----
NFS:
NFS: Proc = 19 (Get filesystem information)
NFS: Status = 70 (Stale NFS file handle)
NFS: Post-operation attributes: (not available)
NFS:
NFS: ----- Sun NFS -----
NFS:
NFS: Proc = 18 (Get filesystem statistics)
NFS: File handle = 0080001600000002000A000000000002
NFS: 737B83D0
NFS:
NFS: ----- Sun NFS -----
NFS:
NFS: Proc = 18 (Get filesystem statistics)
NFS: Status = 70 (Stale NFS file handle)
NFS: Post-operation attributes: (not available)
NFS:
Thanks,
serge
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199708302342.TAA01102>
