Whamcloud - gitweb
LU-10467 mdc: change ssleep to msleep_interruptible 88/37488/3
authorJames Simmons <jsimmons@infradead.org>
Mon, 17 Feb 2020 16:31:47 +0000 (11:31 -0500)
committerOleg Drokin <green@whamcloud.com>
Tue, 25 Feb 2020 05:50:24 +0000 (05:50 +0000)
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 <jsimmons@infradead.org>
Reviewed-on: https://review.whamcloud.com/37488
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Neil Brown <neilb@suse.de>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Shaun Tancheff <shaun.tancheff@hpe.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/mdc/mdc_request.c

index f20f101..cc71e1b 100644 (file)
@@ -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;
        }