[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240408215231.3376659-1-dhavale@google.com>
Date: Mon, 8 Apr 2024 14:52:29 -0700
From: Sandeep Dhavale <dhavale@...gle.com>
To: Gao Xiang <xiang@...nel.org>, Chao Yu <chao@...nel.org>, Yue Hu <huyue2@...lpad.com>,
Jeffle Xu <jefflexu@...ux.alibaba.com>, Sandeep Dhavale <dhavale@...gle.com>,
Chunhai Guo <guochunhai@...o.com>
Cc: linux-erofs@...ts.ozlabs.org,
syzbot+27cc650ef45b379dfe5a@...kaller.appspotmail.com,
kernel-team@...roid.com, linux-kernel@...r.kernel.org
Subject: [PATCH v1] erofs: use raw_smp_processor_id() to get buffer from
global buffer pool
erofs will decompress in the preemptible context (kworker or per cpu
thread). As smp_processor_id() cannot be used in preemptible contexts,
use raw_smp_processor_id() instead to index into global buffer pool.
Reported-by: syzbot+27cc650ef45b379dfe5a@...kaller.appspotmail.com
Fixes: 7a7513292cc6 ("erofs: rename per-CPU buffers to global buffer pool and make it configurable")
Signed-off-by: Sandeep Dhavale <dhavale@...gle.com>
---
fs/erofs/zutil.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/erofs/zutil.c b/fs/erofs/zutil.c
index b9b99158bb4e..036024bce9f7 100644
--- a/fs/erofs/zutil.c
+++ b/fs/erofs/zutil.c
@@ -30,7 +30,7 @@ static struct shrinker *erofs_shrinker_info;
static unsigned int z_erofs_gbuf_id(void)
{
- return smp_processor_id() % z_erofs_gbuf_count;
+ return raw_smp_processor_id() % z_erofs_gbuf_count;
}
void *z_erofs_get_gbuf(unsigned int requiredpages)
--
2.44.0.478.gd926399ef9-goog
Powered by blists - more mailing lists