From 23cdbb827eee6ee298ed2462dccd3abcf1589f37 Mon Sep 17 00:00:00 2001 From: James Simmons Date: Mon, 17 Feb 2020 11:31:47 -0500 Subject: [PATCH] LU-10467 mdc: change ssleep to msleep_interruptible During review of the mdc wait_idle* changes for mdc_getpage() it was pointed out that the use of ssleep() prevents the code from being interruptible. Change ssleep to msleep_interruptible() to allow breaking out of the sleep if an application sends and INTR signal. Change-Id: I2fcb90ecdd6f2c4f2ee6fbc54d253622e8beee29 Signed-off-by: James Simmons Reviewed-on: https://review.whamcloud.com/37488 Tested-by: jenkins Reviewed-by: Neil Brown Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Shaun Tancheff Reviewed-by: Oleg Drokin --- lustre/mdc/mdc_request.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lustre/mdc/mdc_request.c b/lustre/mdc/mdc_request.c index f20f101..cc71e1b 100644 --- a/lustre/mdc/mdc_request.c +++ b/lustre/mdc/mdc_request.c @@ -1088,7 +1088,12 @@ restart_bulk: exp->exp_obd->obd_name, -EIO); RETURN(-EIO); } - ssleep(resends); + + /* If a signal interrupts then the timeout returned will + * not be zero. In that case return -EINTR + */ + if (msleep_interruptible(resends * 1000)) + RETURN(-EINTR); goto restart_bulk; } -- 1.8.3.1