Whamcloud - gitweb
LU-5024 mdc: don't assert on name pack 61/29161/5
authorLai Siyao <lai.siyao@intel.com>
Fri, 22 Sep 2017 02:42:07 +0000 (10:42 +0800)
committerOleg Drokin <oleg.drokin@intel.com>
Wed, 22 Nov 2017 03:55:34 +0000 (03:55 +0000)
For old version of MDTs which don't support ATTRFID, open will pack
dentry name in the request, but this name may change if there is
concurrent rename, as a result an assertion will be triggerred.

It's inconvenient to copy name in advance or take dentry lock in the
call chain, so It's better to remove this assert, which is safe.

Signed-off-by: Lai Siyao <lai.siyao@intel.com>
Change-Id: I58d8b8fbbd8057aa2e8618e8923d0432f31dac96
Reviewed-on: https://review.whamcloud.com/29161
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
lustre/mdc/mdc_lib.c

index b38c91c..459f9f4 100644 (file)
@@ -116,7 +116,11 @@ static void mdc_pack_name(struct ptlrpc_request *req,
 
        cpy_len = strlcpy(buf, name, buf_size);
 
-       LASSERT(cpy_len == name_len && lu_name_is_valid_2(buf, cpy_len));
+       LASSERT(lu_name_is_valid_2(buf, cpy_len));
+       if (cpy_len != name_len)
+               CDEBUG(D_DENTRY, "%s: %s len %zd != %zd, concurrent rename?\n",
+                      req->rq_export->exp_obd->obd_name, buf, name_len,
+                      cpy_len);
 }
 
 void mdc_file_secctx_pack(struct ptlrpc_request *req, const char *secctx_name,