This is not the initial crash location - the machine was dead (and no serial
console yet). But after restarting, about 6-10 clients tried to reconnect
to NFSD and caused the crash.
The crash appears because "child->d_inode->i_op->lookup == NULL"
struct dentry *nfsd_findparent(struct dentry *child)
{
struct dentry *tdentry, *pdentry;
tdentry = d_alloc(child, &(const struct qstr) {"..", 2, 0});
if (!tdentry)
return ERR_PTR(-ENOMEM);
/* I'm going to assume that if the returned dentry is different, then
* it is well connected. But nobody returns different dentrys do they?
*/
/* added safety check to prevent crash - peewee */
if (child->d_inode->i_op && child->d_inode->i_op->lookup){
pdentry = child->d_inode->i_op->lookup(child->d_inode, tdentry);
} else {
printk("normally we had been crashing\n");
printk("child: %p\n",child);
printk("child->d_inode: %p\n",child->d_inode);
printk("child->d_inode->i_op: %p\n",child->d_inode->i_op);
printk("child->d_inode->i_op->lookup: %p\n",child->d_inode->i_op->lookup);
return( ERR_PTR(-EINVAL) );
}
d_drop(tdentry); /* we never want ".." hashed */
if (!pdentry && tdentry->d_inode == NULL) {
/* File system cannot find ".." ... sad but possible */
dput(tdentry);
^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ this one was removed in 2.4.10
pdentry = ERR_PTR(-EINVAL);
}
if (!pdentry) {
/* I don't want to return a ".." dentry.
* I would prefer to return an unconnected "IS_ROOT" dentry,
[...]
If I use 2.4.12-xfs (with nfs-utils 0.3.3), clients can't create an archive with "ar":
[ strace output of "ar" creating a lib out of several *.o]
write(5, "\0\0\1\2\0\0H\2\0\0\1\2\0\0L\2\0\0\1\2\0\0P\2\0\0\1\2\0"..., 3254) = 3
close(5) = 0
munmap(0x4001f000, 4096) = 0
lstat64("lumenuila.a", {st_mode=S_IFREG|0644, st_size=8, ...}) = 0
rename("stO1wjGV", "lumenuila.a") = -1 ESTALE (Stale NFS file handle)
My main question is: Is it possible that some interaction with xfs<->nfsd
causes this kind of trouble? Especially when lookup("..") fails - and dealing
with "disconnected dentries". Does the nfs_fh carry not enough information
( when is oldfh used, when the newer one? [ref_fh->fh_handle.fh_version == 0xca]).
So we have an inode with no proper inode_operations, huh?
I don't use NFSv3, should I?
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/