X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lustre%2Finclude%2Flinux%2Flustre_lib.h;h=bfb480bddde22e0373a1475ed4564d29e14345f5;hp=3c9f0819248ed2b9100aa20a86a9cba7485b7b39;hb=404dd95cb8369e1400f7b83094889736123b82c6;hpb=1b1e975b04411d9f0ecc8318674db3173d1aa79b diff --git a/lustre/include/linux/lustre_lib.h b/lustre/include/linux/lustre_lib.h index 3c9f081..bfb480b 100644 --- a/lustre/include/linux/lustre_lib.h +++ b/lustre/include/linux/lustre_lib.h @@ -615,6 +615,22 @@ do { \ set_current_state(TASK_INTERRUPTIBLE); \ if (condition) \ break; \ + if (signal_pending(current)) { \ + if (!info->lwi_timeout || __timed_out) { \ + break; \ + } else { \ + /* We have to do this here because some signals */ \ + /* are not blockable - ie from strace(1). */ \ + /* In these cases we want to schedule_timeout() */ \ + /* again, because we don't want that to return */ \ + /* -EINTR when the RPC actually succeeded. */ \ + /* the RECALC_SIGPENDING below will deliver the */ \ + /* signal properly. */ \ + SIGNAL_MASK_LOCK(current, irqflags); \ + CLEAR_SIGPENDING; \ + SIGNAL_MASK_UNLOCK(current, irqflags); \ + } \ + } \ if (info->lwi_timeout && !__timed_out) { \ timeout_remaining = schedule_timeout(timeout_remaining); \ if (timeout_remaining == 0) { \ @@ -631,24 +647,6 @@ do { \ } else { \ schedule(); \ } \ - if (condition) \ - break; \ - if (signal_pending(current)) { \ - if (__timed_out) { \ - break; \ - } else { \ - /* We have to do this here because some signals */ \ - /* are not blockable - ie from strace(1). */ \ - /* In these cases we want to schedule_timeout() */ \ - /* again, because we don't want that to return */ \ - /* -EINTR when the RPC actually succeeded. */ \ - /* the RECALC_SIGPENDING below will deliver the */ \ - /* signal properly. */ \ - SIGNAL_MASK_LOCK(current, irqflags); \ - CLEAR_SIGPENDING; \ - SIGNAL_MASK_UNLOCK(current, irqflags); \ - } \ - } \ } \ \ SIGNAL_MASK_LOCK(current, irqflags); \ @@ -656,7 +654,7 @@ do { \ RECALC_SIGPENDING; \ SIGNAL_MASK_UNLOCK(current, irqflags); \ \ - if (__timed_out && signal_pending(current)) { \ + if ((!info->lwi_timeout || __timed_out) && signal_pending(current)) { \ if (info->lwi_on_signal) \ info->lwi_on_signal(info->lwi_cb_data); \ ret = -EINTR; \