Commit 9e78c38
block: Hold a reference on zone write plugs to schedule submission
Since a zone write plug BIO work is a field of struct blk_zone_wplug, we
must ensure that a zone write plug is never freed when its BIO
submission work is queued or running. Do this by holding a reference on
the zone write plug when the submission work is scheduled for execution
with queue_work() and releasing the reference at the end of the
execution of the work function blk_zone_wplug_bio_work().
The helper function disk_zone_wplug_schedule_bio_work() is introduced to
get a reference on a zone write plug and queue its work. This helper is
used in disk_zone_wplug_unplug_bio() and disk_zone_wplug_handle_error().
Fixes: dd291d7 ("block: Introduce zone write plugging")
Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Link: https://lore.kernel.org/r/20240501110907.96950-6-dlemoal@kernel.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>1 parent 19aad27 commit 9e78c38
1 file changed
+21
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1132 | 1132 | | |
1133 | 1133 | | |
1134 | 1134 | | |
| 1135 | + | |
| 1136 | + | |
| 1137 | + | |
| 1138 | + | |
| 1139 | + | |
| 1140 | + | |
| 1141 | + | |
| 1142 | + | |
| 1143 | + | |
| 1144 | + | |
| 1145 | + | |
| 1146 | + | |
| 1147 | + | |
1135 | 1148 | | |
1136 | 1149 | | |
1137 | 1150 | | |
| |||
1151 | 1164 | | |
1152 | 1165 | | |
1153 | 1166 | | |
| 1167 | + | |
1154 | 1168 | | |
1155 | | - | |
1156 | 1169 | | |
1157 | 1170 | | |
1158 | 1171 | | |
| |||
1252 | 1265 | | |
1253 | 1266 | | |
1254 | 1267 | | |
1255 | | - | |
| 1268 | + | |
1256 | 1269 | | |
1257 | 1270 | | |
1258 | 1271 | | |
1259 | 1272 | | |
1260 | 1273 | | |
1261 | 1274 | | |
1262 | | - | |
| 1275 | + | |
1263 | 1276 | | |
1264 | 1277 | | |
1265 | 1278 | | |
| |||
1275 | 1288 | | |
1276 | 1289 | | |
1277 | 1290 | | |
| 1291 | + | |
| 1292 | + | |
| 1293 | + | |
| 1294 | + | |
1278 | 1295 | | |
1279 | 1296 | | |
1280 | 1297 | | |
| |||
1354 | 1371 | | |
1355 | 1372 | | |
1356 | 1373 | | |
1357 | | - | |
1358 | | - | |
| 1374 | + | |
1359 | 1375 | | |
1360 | 1376 | | |
1361 | 1377 | | |
| |||
0 commit comments