+ if (rc == -ERESTART) {
+ /* We were granted while waiting, nothing left to do */
+ if (lock->l_granted_mode == lock->l_req_mode)
+ GOTO(out, rc = 0);
+ /* Lock was destroyed while we were waiting, abort */
+ if (ldlm_is_destroyed(lock))
+ GOTO(out, rc = -EAGAIN);
+
+ /* Otherwise try again */