Commit 7261d27
nbd: Fix signal handling
[ Upstream commit e56d4b6 ]
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>
Signed-off-by: Sasha Levin <sashal@kernel.org>1 parent 193820e commit 7261d27
1 file changed
Lines changed: 14 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
569 | 569 | | |
570 | 570 | | |
571 | 571 | | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
572 | 576 | | |
573 | 577 | | |
574 | 578 | | |
| |||
652 | 656 | | |
653 | 657 | | |
654 | 658 | | |
655 | | - | |
| 659 | + | |
656 | 660 | | |
657 | 661 | | |
658 | 662 | | |
| |||
693 | 697 | | |
694 | 698 | | |
695 | 699 | | |
696 | | - | |
| 700 | + | |
697 | 701 | | |
698 | 702 | | |
699 | 703 | | |
| |||
990 | 994 | | |
991 | 995 | | |
992 | 996 | | |
993 | | - | |
| 997 | + | |
994 | 998 | | |
995 | 999 | | |
996 | 1000 | | |
| |||
1004 | 1008 | | |
1005 | 1009 | | |
1006 | 1010 | | |
1007 | | - | |
| 1011 | + | |
1008 | 1012 | | |
1009 | 1013 | | |
1010 | 1014 | | |
1011 | 1015 | | |
1012 | 1016 | | |
1013 | 1017 | | |
1014 | | - | |
| 1018 | + | |
1015 | 1019 | | |
1016 | 1020 | | |
1017 | 1021 | | |
| |||
1034 | 1038 | | |
1035 | 1039 | | |
1036 | 1040 | | |
1037 | | - | |
| 1041 | + | |
1038 | 1042 | | |
1039 | 1043 | | |
1040 | 1044 | | |
| |||
1047 | 1051 | | |
1048 | 1052 | | |
1049 | 1053 | | |
1050 | | - | |
| 1054 | + | |
1051 | 1055 | | |
1052 | 1056 | | |
1053 | 1057 | | |
| |||
1066 | 1070 | | |
1067 | 1071 | | |
1068 | 1072 | | |
1069 | | - | |
| 1073 | + | |
1070 | 1074 | | |
1071 | 1075 | | |
1072 | 1076 | | |
1073 | 1077 | | |
1074 | | - | |
| 1078 | + | |
1075 | 1079 | | |
1076 | 1080 | | |
1077 | 1081 | | |
1078 | 1082 | | |
1079 | 1083 | | |
1080 | 1084 | | |
1081 | | - | |
| 1085 | + | |
1082 | 1086 | | |
1083 | 1087 | | |
1084 | 1088 | | |
| |||
1098 | 1102 | | |
1099 | 1103 | | |
1100 | 1104 | | |
1101 | | - | |
1102 | | - | |
1103 | | - | |
1104 | | - | |
1105 | 1105 | | |
1106 | 1106 | | |
1107 | 1107 | | |
| |||
0 commit comments