Re: [PATCH] NFSv3 symlink bug

Trond Myklebust (trond.myklebust@fys.uio.no)
13 Oct 2001 21:12:15 +0200


>>>>> " " == David Chow <davidchow@rcn.com.hk> writes:

> Not just that. the call to vfs_symlink on an NFS v3 mounted
> filesystem, the dentry that passed to vfs_symlink did not
> result with an inode member it remains null. This also lead to
> problem in the dcache and didn't have a d_instantiate() and
> d_add() in the nfs_symlink() . I have proved this is a bug. in

Wrong. Look again... We do instantiate NFSv3 symlinks.

> kernel version 2.4.0 up to 2.4.10 . Not tested with 2.4.12 and
> 2.4.11 . This will not affect most of the process context

The only bug I can see is if nfs_fhget() fails to allocate a new
inode. In that case we should drop the dentry. That should be a pretty
rare bug though and would only happen under extremely low memory
conditions.

Cheers,
Trond

--- linux-2.4.12/fs/nfs/dir.c.orig Tue Jun 12 20:15:08 2001
+++ linux-2.4.12/fs/nfs/dir.c Sat Oct 13 21:07:26 2001
@@ -928,6 +928,8 @@
&attr, &sym_fh, &sym_attr);
if (!error && sym_fh.size != 0 && (sym_attr.valid & NFS_ATTR_FATTR)) {
error = nfs_instantiate(dentry, &sym_fh, &sym_attr);
+ if (error)
+ d_drop(dentry);
} else {
if (error == -EEXIST)
printk("nfs_proc_symlink: %s/%s already exists??\n",

-
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/