From: Patrick Farrell Date: Wed, 27 Mar 2013 21:27:28 +0000 (-0500) Subject: LU-3020 obdclass: Lustre returns EINTR when SA_RESTART is set X-Git-Tag: 2.3.65~77 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=f89e5ac9ea117137d826d008b64ac3eaa625b456 LU-3020 obdclass: Lustre returns EINTR when SA_RESTART is set When Lustre is in a read or write system call and receives a SIGALRM, it currently returns EINTR at this location. This is problematic because it prevents the system call from being restarted if SA_RESTART is set in the handler. This patch changes behavior in this location to return ERESTARTSYS when a signal is found. Signed-off-by: Patrick Farrell Change-Id: I26e24b8e8e325c5b0bd7d5d20fa97e2180c12263 Reviewed-on: http://review.whamcloud.com/5814 Reviewed-by: Cory Spitz Tested-by: Hudson Reviewed-by: Bob Glossman Tested-by: Maloo Reviewed-by: Andreas Dilger --- diff --git a/lustre/obdclass/cl_lock.c b/lustre/obdclass/cl_lock.c index a796d7e..7a9b4d1 100644 --- a/lustre/obdclass/cl_lock.c +++ b/lustre/obdclass/cl_lock.c @@ -977,7 +977,9 @@ int cl_lock_state_wait(const struct lu_env *env, struct cl_lock *lock) LASSERT(cl_lock_nr_mutexed(env) == 0); - result = -EINTR; + /* Returning ERESTARTSYS instead of EINTR so syscalls + * can be restarted if signals are pending here */ + result = -ERESTARTSYS; if (likely(!OBD_FAIL_CHECK(OBD_FAIL_LOCK_STATE_WAIT_INTR))) { cfs_waitq_wait(&waiter, CFS_TASK_INTERRUPTIBLE); if (!cfs_signal_pending())