Commit fe0a8a9
scsi: libiscsi: Fix NOP race condition
iSCSI NOPs are sometimes "lost", mistakenly sent to the user-land iscsid
daemon instead of handled in the kernel, as they should be, resulting in a
message from the daemon like:
iscsid: Got nop in, but kernel supports nop handling.
This can occur because of the new forward- and back-locks, and the fact
that an iSCSI NOP response can occur before processing of the NOP send is
complete. This can result in "conn->ping_task" being NULL in
iscsi_nop_out_rsp(), when the pointer is actually in the process of being
set.
To work around this, we add a new state to the "ping_task" pointer. In
addition to NULL (not assigned) and a pointer (assigned), we add the state
"being set", which is signaled with an INVALID pointer (using "-1").
Link: https://lore.kernel.org/r/20201106193317.16993-1-leeman.duncan@gmail.com
Reviewed-by: Mike Christie <michael.christie@oracle.com>
Signed-off-by: Lee Duncan <lduncan@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>1 parent 2e6f11a commit fe0a8a9
2 files changed
Lines changed: 18 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
533 | 533 | | |
534 | 534 | | |
535 | 535 | | |
536 | | - | |
537 | | - | |
| 536 | + | |
| 537 | + | |
538 | 538 | | |
539 | 539 | | |
540 | 540 | | |
| |||
738 | 738 | | |
739 | 739 | | |
740 | 740 | | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
741 | 744 | | |
742 | 745 | | |
743 | 746 | | |
| |||
941 | 944 | | |
942 | 945 | | |
943 | 946 | | |
944 | | - | |
945 | | - | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
946 | 952 | | |
947 | 953 | | |
948 | 954 | | |
| |||
957 | 963 | | |
958 | 964 | | |
959 | 965 | | |
| 966 | + | |
| 967 | + | |
960 | 968 | | |
961 | 969 | | |
962 | 970 | | |
963 | 971 | | |
964 | | - | |
965 | 972 | | |
966 | 973 | | |
967 | 974 | | |
| |||
984 | 991 | | |
985 | 992 | | |
986 | 993 | | |
987 | | - | |
| 994 | + | |
988 | 995 | | |
989 | 996 | | |
990 | 997 | | |
| |||
1923 | 1930 | | |
1924 | 1931 | | |
1925 | 1932 | | |
1926 | | - | |
| 1933 | + | |
1927 | 1934 | | |
1928 | 1935 | | |
1929 | 1936 | | |
| |||
2058 | 2065 | | |
2059 | 2066 | | |
2060 | 2067 | | |
2061 | | - | |
| 2068 | + | |
2062 | 2069 | | |
2063 | 2070 | | |
2064 | 2071 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
135 | 138 | | |
136 | 139 | | |
137 | 140 | | |
| |||
0 commit comments