Whamcloud - gitweb
Branch HEAD
authorbobijam <bobijam>
Thu, 30 Aug 2007 04:20:05 +0000 (04:20 +0000)
committerbobijam <bobijam>
Thu, 30 Aug 2007 04:20:05 +0000 (04:20 +0000)
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
lustre/llite/file.c
lustre/mds/mds_open.c

index 890ffec..f910801 100644 (file)
@@ -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>
index f088b60..7c4e5a3 100644 (file)
@@ -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);
         }
 
index 58e4bce..e526ee9 100644 (file)
@@ -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 */