From: Peng Tao <bergwolf@gmail.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-kernel@vger.kernel.org, James Simmons <uja.ornl@gmail.com>,
Patrick Farrell <paf@cray.com>, Peng Tao <bergwolf@gmail.com>,
Andreas Dilger <andreas.dilger@intel.com>
Subject: [PATCH 39/39] staging/lustre/osc: Lustre returns EINTR from writes when SA_RESTART is set
Date: Fri, 15 Nov 2013 00:33:02 +0800 [thread overview]
Message-ID: <1384446782-13741-40-git-send-email-bergwolf@gmail.com> (raw)
In-Reply-To: <1384446782-13741-1-git-send-email-bergwolf@gmail.com>
From: James Simmons <uja.ornl@gmail.com>
When Lustre is in a read or write system call and receives a
SIGALRM, it will return EINTR if interrupted in osc_enter_cache.
This 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 arrives during the call to l_wait_event.
Lustre-change: http://review.whamcloud.com/7002
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3581
Signed-off-by: Patrick Farrell <paf@cray.com>
Signed-off-by: James Simmons <uja.ornl@gmail.com>
Reviewed-by: Rahul Deshmukh <rahul_deshmukh@xyratex.com>
Reviewed-by: Cory Spitz <spitzcor@cray.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: Peng Tao <bergwolf@gmail.com>
Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
---
drivers/staging/lustre/lustre/osc/osc_cache.c | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/lustre/lustre/osc/osc_cache.c b/drivers/staging/lustre/lustre/osc/osc_cache.c
index 7d63a37..abb4604 100644
--- a/drivers/staging/lustre/lustre/osc/osc_cache.c
+++ b/drivers/staging/lustre/lustre/osc/osc_cache.c
@@ -1533,13 +1533,24 @@ static int osc_enter_cache(const struct lu_env *env, struct client_obd *cli,
/* l_wait_event is interrupted by signal, or timed out */
if (rc < 0) {
- if (rc == -ETIMEDOUT) {
+ switch (rc) {
+ case -ETIMEDOUT:
OSC_DUMP_GRANT(D_ERROR, cli,
"try to reserve %d.\n", bytes);
osc_extent_tree_dump(D_ERROR, osc);
rc = -EDQUOT;
+ break;
+ case -EINTR:
+ /* Ensures restartability - LU-3581 */
+ rc = -ERESTARTSYS;
+ break;
+ default:
+ CDEBUG(D_CACHE, "%s: event for cache space @"
+ " %p never arrived due to %d\n",
+ cli->cl_import->imp_obd->obd_name,
+ &ocw, rc);
+ break;
}
-
list_del_init(&ocw.ocw_entry);
GOTO(out, rc);
}
--
1.7.9.5
prev parent reply other threads:[~2013-11-14 16:41 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-14 16:32 [PATCH 00/39] staging/lustre: patch bomb 2 Peng Tao
2013-11-14 16:32 ` [PATCH 01/39] staging/lustre/hsm: remove hsm_nl proc file Peng Tao
2013-11-15 4:26 ` Greg Kroah-Hartman
2013-11-15 10:32 ` Peng Tao
2013-11-14 16:32 ` [PATCH 02/39] staging/lustre/clio: wrong cl_lock usage Peng Tao
2013-11-14 16:32 ` [PATCH 03/39] staging/lustre/build: fix 'deadcode' errors Peng Tao
2013-11-14 16:32 ` [PATCH 04/39] staging/lustre/build: fix 'integer handling' issues Peng Tao
2013-11-14 16:32 ` [PATCH 05/39] staging/lustre/ptlrpc: add rpc_cache Peng Tao
2013-11-14 16:32 ` [PATCH 06/39] staging/lustre/lnet: build Lustre with Intel OFED for Xeon Phi Peng Tao
2013-11-14 16:32 ` [PATCH 07/39] staging/lustre/osd-ldiskfs: remove dependency on mdd module Peng Tao
2013-11-14 16:32 ` [PATCH 08/39] staging/lustre/libcfs: improve validity test for valid file descriptors Peng Tao
2013-11-14 16:32 ` [PATCH 09/39] staging/lustre/llite: use 64bits flags in ll_lov_setea() Peng Tao
2013-11-14 16:32 ` [PATCH 10/39] staging/lustre/hsm: small fixes for HSM Peng Tao
2013-11-14 16:32 ` [PATCH 11/39] staging/lustre/mdt: CDT cleanup follow-on patch Peng Tao
2013-11-14 16:32 ` [PATCH 12/39] staging/lustre/utils: Posix copytool fixes Peng Tao
2013-11-14 16:32 ` [PATCH 13/39] staging/lustre/lmv: update coding style Peng Tao
2013-11-14 16:32 ` [PATCH 14/39] staging/lustre/hsm: copy start error should set HP_FLAG_COMPLETED Peng Tao
2013-11-14 16:32 ` [PATCH 15/39] staging/lustre/lov: Get the correct address of lmm_objects Peng Tao
2013-11-14 16:32 ` [PATCH 16/39] staging/lustre/lvfs: remove llog_lvfs.c and other lvfs code from llog Peng Tao
2013-11-14 16:32 ` [PATCH 17/39] staging/lustre/llite: reset writeback index in ll_writepages Peng Tao
2013-11-14 16:32 ` [PATCH 18/39] staging/lustre/llite: Delaying creation of client side proc entries Peng Tao
2013-11-14 16:32 ` [PATCH 19/39] staging/lustre/libcfs: Add relocation function to libcfs heap Peng Tao
2013-11-14 16:32 ` [PATCH 20/39] staging/lustre/build: fix 'data race condition' issues Peng Tao
2013-11-14 16:32 ` [PATCH 21/39] staging/lustre/autoconf: remove LC_LOCK_MAP_ACQUIRE test Peng Tao
2013-11-14 16:32 ` [PATCH 22/39] staging/lustre/mdc: document mdc_rpc_lock Peng Tao
2013-11-14 16:32 ` [PATCH 23/39] staging/lustre/autoconf: remove LC_FS_STRUCT_USE_PATH Peng Tao
2013-11-14 16:32 ` [PATCH 24/39] staging/lustre/obdclass: fix wrong device put in case of race Peng Tao
2013-11-14 16:32 ` [PATCH 25/39] staging/lustre/lmv: choose right MDT for open by FID Peng Tao
2013-11-14 16:32 ` [PATCH 26/39] staging/lustre/osd: remove fld lookup during configuration Peng Tao
2013-11-14 16:32 ` [PATCH 27/39] staging/lustre/mdt: HSM EXIST event not triggered at last rm/mv Peng Tao
2013-11-14 16:32 ` [PATCH 28/39] staging/lustre/ldlm: ldlm_flock_deadlock() ASSERTION( req != lock ) failed Peng Tao
2013-11-14 16:32 ` [PATCH 29/39] staging/lustre/changelogs: Account for changelog_ext_rec in CR_MAXSIZE Peng Tao
2013-11-14 16:32 ` [PATCH 30/39] staging/lustre/build: build error with gcc 4.7.0 20110509 Peng Tao
2013-11-14 16:32 ` [PATCH 31/39] staging/lustre/build: fix 'NULL pointer dereference' errors Peng Tao
2013-11-14 16:32 ` [PATCH 32/39] staging/lustre/clio: honor O_NOATIME Peng Tao
2013-11-14 16:32 ` [PATCH 33/39] staging/lustre/llite: return compatible fsid for statfs Peng Tao
2013-11-14 16:32 ` [PATCH 34/39] staging/lustre/llite: cancel open lock before closing file Peng Tao
2013-11-14 16:32 ` [PATCH 35/39] staging/lustre/hsm: Add support to drop all pages for ll_data_version Peng Tao
2013-11-14 16:32 ` [PATCH 36/39] staging/lustre/build: fix 'no effect' errors Peng Tao
2013-11-14 16:33 ` [PATCH 37/39] staging/lustre/obd: add md_stats to MDC and LMV devices Peng Tao
2013-11-14 16:33 ` [PATCH 38/39] staging/lustre/autoconf: remove LC_SECURITY_PLUG test Peng Tao
2013-11-14 16:33 ` Peng Tao [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1384446782-13741-40-git-send-email-bergwolf@gmail.com \
--to=bergwolf@gmail.com \
--cc=andreas.dilger@intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=paf@cray.com \
--cc=uja.ornl@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).