Whamcloud - gitweb
LU-10212 ldlm: fix prolong for destroyed lock 92/29992/6
authorAlexander Boyko <c17825@cray.com>
Wed, 8 Nov 2017 19:30:05 +0000 (14:30 -0500)
committerOleg Drokin <oleg.drokin@intel.com>
Thu, 4 Jan 2018 02:48:01 +0000 (02:48 +0000)
For a IO request ofd_prolong_extent_locks use
a fast path if the lock is found by handle. If the lock
has LDLM_FL_DESTROYED, prolong should try a general path.

No lock was accounted for IO request with destroyed lock
and ESTALE error happaned for a client.

operation ost_read to node x.x.x.x@o2ib failed: rc = -116

Signed-off-by: Alexander Boyko <c17825@cray.com>
Change-Id: I63e619d0330279bb2ae678ed98b1c0e899ad4e08
Reviewed-on: https://review.whamcloud.com/29992
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Andriy Skulysh <c17819@cray.com>
Reviewed-by: Mike Pershin <mike.pershin@intel.com>
lustre/ofd/ofd_dev.c

index 69d8e84..8ac0469 100644 (file)
@@ -2430,10 +2430,14 @@ static void ofd_prolong_extent_locks(struct tgt_session_info *tsi,
                                LASSERT(lock->l_export == data->lpa_export);
                                ldlm_lock_prolong_one(lock, data);
                                LDLM_LOCK_PUT(lock);
                                LASSERT(lock->l_export == data->lpa_export);
                                ldlm_lock_prolong_one(lock, data);
                                LDLM_LOCK_PUT(lock);
-                               RETURN_EXIT;
+                               if (data->lpa_locks_cnt > 0)
+                                       RETURN_EXIT;
+                               /* The lock was destroyed probably lets try
+                                * resource tree. */
+                       } else {
+                               lock->l_last_used = ktime_get();
+                               LDLM_LOCK_PUT(lock);
                        }
                        }
-                       lock->l_last_used = ktime_get();
-                       LDLM_LOCK_PUT(lock);
                }
        }
 
                }
        }