android_kernel_motorola_sm6375/drivers/block
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Sarah Newman 0336bfe9c2 drbd: add missing kref_get in handle_write_conflicts
[ Upstream commit 00c9c9628b49e368d140cfa61d7df9b8922ec2a8 ]

With `two-primaries` enabled, DRBD tries to detect "concurrent" writes
and handle write conflicts, so that even if you write to the same sector
simultaneously on both nodes, they end up with the identical data once
the writes are completed.

In handling "superseeded" writes, we forgot a kref_get,
resulting in a premature drbd_destroy_device and use after free,
and further to kernel crashes with symptoms.

Relevance: No one should use DRBD as a random data generator, and apparently
all users of "two-primaries" handle concurrent writes correctly on layer up.
That is cluster file systems use some distributed lock manager,
and live migration in virtualization environments stops writes on one node
before starting writes on the other node.

Which means that other than for "test cases",
this code path is never taken in real life.

FYI, in DRBD 9, things are handled differently nowadays.  We still detect
"write conflicts", but no longer try to be smart about them.
We decided to disconnect hard instead: upper layers must not submit concurrent
writes. If they do, that's their fault.

Signed-off-by: Sarah Newman <srn@prgmr.com>
Signed-off-by: Lars Ellenberg <lars@linbit.com>
Signed-off-by: Christoph Böhmwalder <christoph.boehmwalder@linbit.com>
Link: https://lore.kernel.org/r/20250627095728.800688-1-christoph.boehmwalder@linbit.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2025-08-28 16:21:24 +02:00
..
aoe aoe: clean device rq_list in aoedev_downdev() 2025-06-27 11:02:57 +01:00
drbd drbd: add missing kref_get in handle_write_conflicts 2025-08-28 16:21:24 +02:00
mtip32xx
paride
rsxx
xen-blkback
zram zram: refuse to use zero sized block device as backing device 2025-01-09 13:23:29 +01:00
amiflop.c
ataflop.c
brd.c
cryptoloop.c
floppy.c floppy: use a statically allocated error counter 2022-05-25 09:14:31 +02:00
Kconfig remove the sx8 block driver 2023-11-08 11:23:42 +01:00
loop.c loop: loop_set_status_from_info() check before assignment 2024-04-13 12:51:30 +02:00
loop.h
Makefile remove the sx8 block driver 2023-11-08 11:23:42 +01:00
nbd.c nbd: don't allow reconnect after disconnect 2025-03-13 12:42:52 +01:00
null_blk.h
null_blk_main.c null_blk: Fix the WARNING: modpost: missing MODULE_DESCRIPTION() 2024-06-16 13:28:45 +02:00
null_blk_zoned.c
pktcdvd.c
ps3disk.c
ps3vram.c
rbd.c rbd: don't assume RBD_LOCK_STATE_LOCKED for exclusive mappings 2024-08-19 05:33:40 +02:00
rbd_types.h
skd_main.c
skd_s1120.h
sunvdc.c sunvdc: Balance device refcount in vdc_port_mpgroup_check 2025-08-28 16:21:23 +02:00
swim.c
swim3.c
swim_asm.S
umem.c
umem.h
virtio_blk.c virtio-blk: don't keep queue frozen during system suspend 2025-01-09 13:23:32 +01:00
xen-blkfront.c xen/blkfront: Only check REQ_FUA for writes 2023-06-21 15:44:09 +02:00
xsysace.c
z2ram.c