From 495bd54e094648c860249c87e22171272ba7468d Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Thu, 1 Nov 2018 04:43:58 +0000 Subject: [PATCH] iscsi-scst: fix a subtle race inside the EXTRACHECKs facility git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/3.3.x@7592 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- iscsi-scst/kernel/iscsi.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/iscsi-scst/kernel/iscsi.h b/iscsi-scst/kernel/iscsi.h index 6c7f0a926..1e95f1410 100644 --- a/iscsi-scst/kernel/iscsi.h +++ b/iscsi-scst/kernel/iscsi.h @@ -404,9 +404,16 @@ struct iscsi_cmnd { */ unsigned int data_out_in_data_receiving:1; unsigned int force_release_done:1; + #ifdef CONFIG_SCST_EXTRACHECKS - unsigned int on_rx_digest_list:1; unsigned int release_called:1; + + /* + * This flag might be cleared from SCST thread after/during RX digest + * calculation in parallel with clearing release_called from the + * read thread, so it must be modifiable inependently. + */ + unsigned long on_rx_digest_list:1 __aligned(sizeof(long)); #endif /*