From e40533f967e25bc4b66cace81c85f6d10bf7eff6 Mon Sep 17 00:00:00 2001 From: bobijam <bobijam> Date: Thu, 30 Aug 2007 04:20:05 +0000 Subject: [PATCH] Branch HEAD b=13030 i=green, shadow Description: "ll_intent_file_open()) lock enqueue: err: -13" with nfs Details : with NFS, the anon dentry's parent was set to itself in d_alloc_anon(), so in MDS, we use rec->ur_fid1 to find the corresponding dentry other than use rec->ur_name. --- lustre/ChangeLog | 7 +++++++ lustre/llite/file.c | 2 +- lustre/mds/mds_open.c | 15 ++++++++++++++- 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/lustre/ChangeLog b/lustre/ChangeLog index 890ffec4a7..f910801096 100644 --- a/lustre/ChangeLog +++ b/lustre/ChangeLog @@ -178,6 +178,13 @@ Bugzilla : 13363 Description: test_7 on sanity-quota.sh can't be used on separate machines Details : add facet to handle it +Severity : normal +Bugzilla : 13030 +Description: "ll_intent_file_open()) lock enqueue: err: -13" with nfs +Details : with NFS, the anon dentry's parent was set to itself in + d_alloc_anon(), so in MDS, we use rec->ur_fid1 to find the + corresponding dentry other than use rec->ur_name. + -------------------------------------------------------------------------------- 2007-08-10 Cluster File Systems, Inc. <info@clusterfs.com> diff --git a/lustre/llite/file.c b/lustre/llite/file.c index f088b60727..7c4e5a37c3 100644 --- a/lustre/llite/file.c +++ b/lustre/llite/file.c @@ -356,7 +356,7 @@ static int ll_intent_file_open(struct file *file, void *lmm, if (rc != 0 || it_open_error(DISP_OPEN_OPEN, itp)) { rc = rc ? rc : it_open_error(DISP_OPEN_OPEN, itp); - CERROR("lock enqueue: err: %d\n", rc); + CDEBUG(D_VFSTRACE, "lock enqueue: err: %d\n", rc); GOTO(out, rc); } diff --git a/lustre/mds/mds_open.c b/lustre/mds/mds_open.c index 58e4bce390..e526ee9b49 100644 --- a/lustre/mds/mds_open.c +++ b/lustre/mds/mds_open.c @@ -981,7 +981,20 @@ int mds_open(struct mds_update_record *rec, int offset, } /* Step 2: Lookup the child */ - dchild = ll_lookup_one_len(rec->ur_name, dparent, rec->ur_namelen - 1); + + if (!(lustre_msg_get_flags(req->rq_reqmsg) & MSG_REPLAY) && + (rec->ur_flags & MDS_OPEN_LOCK) && (rec->ur_namelen == 1)) { + /* hack for nfsd with no_subtree_check, it will use anon + * dentry w/o filename to open the file. the anon dentry's + * parent was set to itself, so rec->ur_fid1 is the file. + * And in MDC it cannot derive the dentry's parent dentry, + * hence the file's name, so we hack here in MDS, + * refer to bug 13030. */ + dchild = mds_fid2dentry(mds, rec->ur_fid1, NULL); + } else { + dchild = ll_lookup_one_len(rec->ur_name, dparent, + rec->ur_namelen - 1); + } if (IS_ERR(dchild)) { rc = PTR_ERR(dchild); dchild = NULL; /* don't confuse mds_finish_transno() below */ -- GitLab