aboutsummaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python/export-to-postgresql.py
diff options
context:
space:
mode:
authorChristoph Böhmwalder <[email protected]>2022-10-20 10:52:05 +0200
committerJens Axboe <[email protected]>2022-10-20 05:45:21 -0700
commit6d42ddf7f27b6723549ee6d4c8b1b418b59bf6b5 (patch)
tree8428578275365a3e9a8871bfbce3231c22b2a680 /tools/perf/scripts/python/export-to-postgresql.py
parent70ee4a4c97d7332519b2072ead0ef9f65ea43662 (diff)
drbd: only clone bio if we have a backing device
Commit c347a787e34cb (drbd: set ->bi_bdev in drbd_req_new) moved a bio_set_dev call (which has since been removed) to "earlier", from drbd_request_prepare to drbd_req_new. The problem is that this accesses device->ldev->backing_bdev, which is not NULL-checked at this point. When we don't have an ldev (i.e. when the DRBD device is diskless), this leads to a null pointer deref. So, only allocate the private_bio if we actually have a disk. This is also a small optimization, since we don't clone the bio to only to immediately free it again in the diskless case. Fixes: c347a787e34cb ("drbd: set ->bi_bdev in drbd_req_new") Co-developed-by: Christoph Böhmwalder <[email protected]> Signed-off-by: Christoph Böhmwalder <[email protected]> Co-developed-by: Joel Colledge <[email protected]> Signed-off-by: Joel Colledge <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/export-to-postgresql.py')
0 files changed, 0 insertions, 0 deletions