diff --git a/lustre/ChangeLog b/lustre/ChangeLog index 890ffec4a7061790357b37185ecdee5c25ff5d9d..f910801096a84fb040f3a23c4e73ed7bf7c53a85 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 f088b60727cf353fddede7f1cc9ff341b7f07db8..7c4e5a37c3679312051edf6a7635e54318b0029b 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 58e4bce390b0831598533117e81c561b02977087..e526ee9b4904791a168888706f5d958e54bcdff0 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 */