summaryrefslogtreecommitdiff
path: root/lib/pm-notifier-error-inject.c
diff options
context:
space:
mode:
authorMike Snitzer <snitzer@redhat.com>2017-11-22 14:56:12 -0500
committerMike Snitzer <snitzer@redhat.com>2017-12-13 12:15:58 -0500
commit318716ddea0829d3be566efc69d31029c40d51e2 (patch)
tree20933ee1320f34e07218541df77f3f406b044e5d /lib/pm-notifier-error-inject.c
parentf31c21e4365c02ccf7226c33ea978cd5dbfc351e (diff)
downloadlinux-318716ddea0829d3be566efc69d31029c40d51e2.tar.gz
linux-318716ddea0829d3be566efc69d31029c40d51e2.tar.xz
dm: safely allocate multiple bioset bios
DM targets can request multiple bios be sent to them by DM core (see: num_{flush,discard,write_same,write_zeroes}_bios). But until now these bios were allocated in an unsafe manner than could potentially exhaust the DM device's bioset -- in the face of multiple threads each trying to do multiple allocations from the same DM device's bioset. Fix __send_duplicate_bios() by using the new alloc_multiple_bios(). The allocation strategy used by alloc_multiple_bios() models that used by dm-crypt.c:crypt_alloc_buffer(). Neil Brown initially proposed this fix but the implementation has been revised enough that it inappropriate to attribute the entirety of it to him. Suggested-by: NeilBrown <neilb@suse.com> Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Diffstat (limited to 'lib/pm-notifier-error-inject.c')
0 files changed, 0 insertions, 0 deletions