提交 ad8dbc93 编写于 作者: P Patrick Farrell 提交者: Greg Kroah-Hartman

staging/lustre/nfs: writing to new files will return ENOENT

This happend with SLES11SP2 Lustre client, which in turn acts as an
NFS server, exporting a subtree of an Lustre fs through NFS.

We detected that whenever we are writing to a new file using, fx,
'echo blah > newfile', it will return ENOENT error. We found
out that this was caused by the anonymous dentry. In SLESS11SP2,
anonymous dentries are assigned '/' as the name, instead of an
empty string. When MDT handles the intent_open call, it will look
up the obj by the name if it is not an empty string, and thus
couldn't find it.

As MDS_OPEN_BY_FID is always set on this request, we never need
to send the name in this request.  The fid is already available
and should be used in case the file has been renamed.

Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3544
Lustre-change: http://review.whamcloud.com/6920Signed-off-by: NCheng Shao <cheng_shao@xyratex.com>
Signed-off-by: NPatrick Farrell <paf@cray.com>
Reviewed-by: NBob Glossman <bob.glossman@intel.com>
Reviewed-by: NAlexey Shvetsov <alexxy@gentoo.org>
Reviewed-by: NLai Siyao <lai.siyao@intel.com>
Reviewed-by: NJames Simmons <uja.ornl@gmail.com>
Reviewed-by: NOleg Drokin <oleg.drokin@intel.com>
Signed-off-by: NPeng Tao <bergwolf@gmail.com>
Signed-off-by: NAndreas Dilger <andreas.dilger@intel.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 65f1c781
......@@ -368,8 +368,6 @@ static int ll_intent_file_open(struct file *file, void *lmm,
{
struct ll_sb_info *sbi = ll_i2sbi(file->f_dentry->d_inode);
struct dentry *parent = file->f_dentry->d_parent;
const char *name = file->f_dentry->d_name.name;
const int len = file->f_dentry->d_name.len;
struct md_op_data *op_data;
struct ptlrpc_request *req;
__u32 opc = LUSTRE_OPC_ANY;
......@@ -394,8 +392,9 @@ static int ll_intent_file_open(struct file *file, void *lmm,
}
op_data = ll_prep_md_op_data(NULL, parent->d_inode,
file->f_dentry->d_inode, name, len,
file->f_dentry->d_inode, NULL, 0,
O_RDWR, opc, NULL);
if (IS_ERR(op_data))
return PTR_ERR(op_data);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册