__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)) {
ll_invalidate_aliases(inode);
iput(inode);
+ RETURN_EXIT;
}
/* Check if the given lock may be downgraded instead of canceling and