summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPankaj Raghav <p.raghav@samsung.com>2023-02-17 15:14:44 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-03-10 11:34:34 +0300
commit7ebde70510a12835a2a4168e2600b41456ffc314 (patch)
tree7a803b43fae5bd770baa49e0e6fffdf3959c3e5d
parent48d46319bedc7d759eee5d087dd91ee665338e08 (diff)
downloadlinux-7ebde70510a12835a2a4168e2600b41456ffc314.tar.xz
brd: use radix_tree_maybe_preload instead of radix_tree_preload
commit 0aa2988e4fd23c0c8b33999d7b47dfbc5e6bf24b upstream. Unconditionally calling radix_tree_preload_end() results in a OOPS message as the preload is only conditionally called for gfpflags_allow_blocking(). [ 20.267323] BUG: using smp_processor_id() in preemptible [00000000] code: fio/416 [ 20.267837] caller is brd_insert_page.part.0+0xbe/0x190 [brd] [ 20.269436] Call Trace: [ 20.269598] <TASK> [ 20.269742] dump_stack_lvl+0x32/0x50 [ 20.269982] check_preemption_disabled+0xd1/0xe0 [ 20.270289] brd_insert_page.part.0+0xbe/0x190 [brd] [ 20.270664] brd_submit_bio+0x33f/0xf40 [brd] Use radix_tree_maybe_preload() which does preload only if gfpflags_allow_blocking() is true but also takes the lock. Therefore, unconditionally calling radix_tree_preload_end() should not create any issues and the message disappears. Fixes: 6ded703c56c2 ("brd: check for REQ_NOWAIT and set correct page allocation mask") Signed-off-by: Pankaj Raghav <p.raghav@samsung.com> Link: https://lore.kernel.org/r/20230217121442.33914-1-p.raghav@samsung.com Signed-off-by: Jens Axboe <axboe@kernel.dk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/block/brd.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/block/brd.c b/drivers/block/brd.c
index 740631dcdd0e..a8a77a1efe1e 100644
--- a/drivers/block/brd.c
+++ b/drivers/block/brd.c
@@ -94,7 +94,7 @@ static int brd_insert_page(struct brd_device *brd, sector_t sector, gfp_t gfp)
if (!page)
return -ENOMEM;
- if (gfpflags_allow_blocking(gfp) && radix_tree_preload(gfp)) {
+ if (radix_tree_maybe_preload(gfp)) {
__free_page(page);
return -ENOMEM;
}