Whamcloud - gitweb
LU-11359 mdt: fix mdt_dom_discard_data() timeouts
[fs/lustre-release.git] / lustre / llite / namei.c
index 39778ea..f21f961 100644 (file)
@@ -233,8 +233,20 @@ void ll_lock_cancel_bits(struct ldlm_lock *lock, __u64 to_cancel)
        __u64 bits = to_cancel;
        int rc;
 
-       if (inode == NULL)
-               return;
+       ENTRY;
+
+       if (!inode) {
+               /* That means the inode is evicted most likely and may cause
+                * the skipping of lock cleanups below, so print the message
+                * about that in log.
+                */
+               if (lock->l_resource->lr_lvb_inode)
+                       LDLM_DEBUG(lock,
+                                  "can't take inode for the lock (%sevicted)\n",
+                                  lock->l_resource->lr_lvb_inode->i_state &
+                                  I_FREEING ? "" : "not ");
+               RETURN_EXIT;
+       }
 
        if (!fid_res_name_eq(ll_inode2fid(inode),
                             &lock->l_resource->lr_name)) {
@@ -372,6 +384,7 @@ void ll_lock_cancel_bits(struct ldlm_lock *lock, __u64 to_cancel)
                ll_invalidate_aliases(inode);
 
        iput(inode);
+       RETURN_EXIT;
 }
 
 /* Check if the given lock may be downgraded instead of canceling and