[Devel] [PATCH RH7 v2 4/4] bcache: fix cache_set_flush() NULL pointer dereference on OOM #PSBM-106785

2020-09-14 Thread Andrey Ryabinin
From: Eric Wheeler When bch_cache_set_alloc() fails to kzalloc the cache_set, the asyncronous closure handling tries to dereference a cache_set that hadn't yet been allocated inside of cache_set_flush() which is called by __cache_set_unregister() during cleanup. This appears to happen only

[Devel] [PATCH RH7 v2 3/4] bcache: unregister reboot notifier if bcache fails to unregister device #PSBM-106785

2020-09-14 Thread Andrey Ryabinin
From: Zheng Liu In bcache_init() function it forgot to unregister reboot notifier if bcache fails to unregister a block device. This commit fixes this. Signed-off-by: Zheng Liu Tested-by: Joshua Schmid Tested-by: Eric Wheeler Cc: Kent Overstreet Cc: sta...@vger.kernel.org Signed-off-by:

[Devel] [PATCH RH7 v2 2/4] bcache: Data corruption fix #PSBM-106785

2020-09-14 Thread Andrey Ryabinin
From: Kent Overstreet The code that handles overlapping extents that we've just read back in from disk was depending on the behaviour of the code that handles overlapping extents as we're inserting into a btree node in the case of an insert that forced an existing extent to be split: on insert,

[Devel] [PATCH RH7 v2 1/4] bcache: Fix crashes of bcache used with raid1 #PSBM-106785

2020-09-14 Thread Andrey Ryabinin
When bcache is built on top of raid1 devices, the following warning happens: WARNING: CPU: 2 PID: 8138 at include/linux/bio.h:559 raid1_write_request+0x994/0xba0 [raid1] Call Trace: dump_stack+0x19/0x1b __warn+0xd8/0x100 warn_slowpath_null+0x1d/0x20 raid1_write_request+0x994/0xba0

[Devel] [PATCH RH7 v2 1/4] bcache: Fix crashes of bcache used with raid1 #PSBM-106785

2020-09-14 Thread Andrey Ryabinin
When bcache is built on top of raid1 devices, the following warning happens: WARNING: CPU: 2 PID: 8138 at include/linux/bio.h:559 raid1_write_request+0x994/0xba0 [raid1] Call Trace: dump_stack+0x19/0x1b __warn+0xd8/0x100 warn_slowpath_null+0x1d/0x20 raid1_write_request+0x994/0xba0

[Devel] [PATCH rh7 v2] keys, user: Fix high order allocation in user_instantiate() #PSBM-107794

2020-09-14 Thread Andrey Ryabinin
Adding user key might trigger 4-order allocation which is unreliable in case of fragmented memory: [ cut here ] WARNING: CPU: 3 PID: 134927 at mm/page_alloc.c:3533 __alloc_pages_nodemask+0x1b1/0x600 order 4 >= 3, gfp 0x40d0 Kernel panic - not syncing: panic_on_warn

Re: [Devel] [PATCH rh7] keys, user: Fix high order allocation in user_instantiate()

2020-09-14 Thread Denis V. Lunev
On 9/14/20 1:55 PM, Andrey Ryabinin wrote: > Adding user key might trigger 4-order allocation which is unreliable > in case of fragmented memory: > > [ cut here ] > WARNING: CPU: 3 PID: 134927 at mm/page_alloc.c:3533 > __alloc_pages_nodemask+0x1b1/0x600 > order 4 >= 3,

[Devel] [PATCH rh7] keys, user: Fix high order allocation in user_instantiate()

2020-09-14 Thread Andrey Ryabinin
Adding user key might trigger 4-order allocation which is unreliable in case of fragmented memory: [ cut here ] WARNING: CPU: 3 PID: 134927 at mm/page_alloc.c:3533 __alloc_pages_nodemask+0x1b1/0x600 order 4 >= 3, gfp 0x40d0 Kernel panic - not syncing: panic_on_warn

[Devel] [PATCH 4/4] bcache: fix cache_set_flush() NULL pointer dereference on OOM

2020-09-14 Thread Andrey Ryabinin
From: Eric Wheeler When bch_cache_set_alloc() fails to kzalloc the cache_set, the asyncronous closure handling tries to dereference a cache_set that hadn't yet been allocated inside of cache_set_flush() which is called by __cache_set_unregister() during cleanup. This appears to happen only

[Devel] [PATCH 3/4] bcache: unregister reboot notifier if bcache fails to unregister device

2020-09-14 Thread Andrey Ryabinin
From: Zheng Liu In bcache_init() function it forgot to unregister reboot notifier if bcache fails to unregister a block device. This commit fixes this. Signed-off-by: Zheng Liu Tested-by: Joshua Schmid Tested-by: Eric Wheeler Cc: Kent Overstreet Cc: sta...@vger.kernel.org Signed-off-by:

[Devel] [PATCH 2/4] bcache: Data corruption fix

2020-09-14 Thread Andrey Ryabinin
From: Kent Overstreet The code that handles overlapping extents that we've just read back in from disk was depending on the behaviour of the code that handles overlapping extents as we're inserting into a btree node in the case of an insert that forced an existing extent to be split: on insert,

[Devel] [PATCH 1/4] bcache: Fix crashes of bcache used with raid1

2020-09-14 Thread Andrey Ryabinin
When bcache is built on top of raid1 devices, the following warning happens: WARNING: CPU: 2 PID: 8138 at include/linux/bio.h:559 raid1_write_request+0x994/0xba0 [raid1] Call Trace: dump_stack+0x19/0x1b __warn+0xd8/0x100 warn_slowpath_null+0x1d/0x20 raid1_write_request+0x994/0xba0