Commit e56d4b6
nbd: Fix signal handling
Both nbd_send_cmd() and nbd_handle_cmd() return either a negative error
number or a positive blk_status_t value. nbd_queue_rq() converts these
return values into a blk_status_t value. There is a bug in the conversion
code: if nbd_send_cmd() returns BLK_STS_RESOURCE, nbd_queue_rq() should
return BLK_STS_RESOURCE instead of BLK_STS_OK. Fix this, move the
conversion code into nbd_handle_cmd() and fix the remaining sparse warnings.
This patch fixes the following sparse warnings:
drivers/block/nbd.c:673:32: warning: incorrect type in return expression (different base types)
drivers/block/nbd.c:673:32: expected int
drivers/block/nbd.c:673:32: got restricted blk_status_t [usertype]
drivers/block/nbd.c:714:48: warning: incorrect type in return expression (different base types)
drivers/block/nbd.c:714:48: expected int
drivers/block/nbd.c:714:48: got restricted blk_status_t [usertype]
drivers/block/nbd.c:1120:21: warning: incorrect type in assignment (different base types)
drivers/block/nbd.c:1120:21: expected int [assigned] ret
drivers/block/nbd.c:1120:21: got restricted blk_status_t [usertype]
drivers/block/nbd.c:1125:16: warning: incorrect type in return expression (different base types)
drivers/block/nbd.c:1125:16: expected restricted blk_status_t
drivers/block/nbd.c:1125:16: got int [assigned] ret
Cc: Christoph Hellwig <hch@lst.de>
Cc: Josef Bacik <jbacik@fb.com>
Cc: Yu Kuai <yukuai3@huawei.com>
Cc: Markus Pargmann <mpa@pengutronix.de>
Fixes: fc17b65 ("blk-mq: switch ->queue_rq return value to blk_status_t")
Cc: stable@vger.kernel.org
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Link: https://lore.kernel.org/r/20240510202313.25209-6-bvanassche@acm.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>1 parent f6cb9a2 commit e56d4b6
1 file changed
Lines changed: 14 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
588 | 588 | | |
589 | 589 | | |
590 | 590 | | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
591 | 595 | | |
592 | 596 | | |
593 | 597 | | |
| |||
670 | 674 | | |
671 | 675 | | |
672 | 676 | | |
673 | | - | |
| 677 | + | |
674 | 678 | | |
675 | 679 | | |
676 | 680 | | |
| |||
711 | 715 | | |
712 | 716 | | |
713 | 717 | | |
714 | | - | |
| 718 | + | |
715 | 719 | | |
716 | 720 | | |
717 | 721 | | |
| |||
1008 | 1012 | | |
1009 | 1013 | | |
1010 | 1014 | | |
1011 | | - | |
| 1015 | + | |
1012 | 1016 | | |
1013 | 1017 | | |
1014 | 1018 | | |
| |||
1022 | 1026 | | |
1023 | 1027 | | |
1024 | 1028 | | |
1025 | | - | |
| 1029 | + | |
1026 | 1030 | | |
1027 | 1031 | | |
1028 | 1032 | | |
1029 | 1033 | | |
1030 | 1034 | | |
1031 | 1035 | | |
1032 | | - | |
| 1036 | + | |
1033 | 1037 | | |
1034 | 1038 | | |
1035 | 1039 | | |
| |||
1052 | 1056 | | |
1053 | 1057 | | |
1054 | 1058 | | |
1055 | | - | |
| 1059 | + | |
1056 | 1060 | | |
1057 | 1061 | | |
1058 | 1062 | | |
| |||
1065 | 1069 | | |
1066 | 1070 | | |
1067 | 1071 | | |
1068 | | - | |
| 1072 | + | |
1069 | 1073 | | |
1070 | 1074 | | |
1071 | 1075 | | |
| |||
1084 | 1088 | | |
1085 | 1089 | | |
1086 | 1090 | | |
1087 | | - | |
| 1091 | + | |
1088 | 1092 | | |
1089 | 1093 | | |
1090 | 1094 | | |
1091 | 1095 | | |
1092 | | - | |
| 1096 | + | |
1093 | 1097 | | |
1094 | 1098 | | |
1095 | 1099 | | |
1096 | 1100 | | |
1097 | 1101 | | |
1098 | 1102 | | |
1099 | | - | |
| 1103 | + | |
1100 | 1104 | | |
1101 | 1105 | | |
1102 | 1106 | | |
| |||
1116 | 1120 | | |
1117 | 1121 | | |
1118 | 1122 | | |
1119 | | - | |
1120 | | - | |
1121 | | - | |
1122 | | - | |
1123 | 1123 | | |
1124 | 1124 | | |
1125 | 1125 | | |
| |||
0 commit comments