mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Gao Xiang <hsiangkao@linux.alibaba.com>
To: Sandeep Dhavale <dhavale@google.com>,
	Gao Xiang <xiang@kernel.org>, Chao Yu <chao@kernel.org>,
	Yue Hu <huyue2@coolpad.com>,
	Jeffle Xu <jefflexu@linux.alibaba.com>,
	Chunhai Guo <guochunhai@vivo.com>
Cc: linux-erofs@lists.ozlabs.org,
	syzbot+27cc650ef45b379dfe5a@syzkaller.appspotmail.com,
	kernel-team@android.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v1] erofs: use raw_smp_processor_id() to get buffer from global buffer pool
Date: Tue, 9 Apr 2024 06:48:41 +0800	[thread overview]
Message-ID: <3b3d0b99-f7b5-4dcc-a631-1018f4025acf@linux.alibaba.com> (raw)
In-Reply-To: <20240408215231.3376659-1-dhavale@google.com>

Hi Sandeep,

On 2024/4/9 05:52, Sandeep Dhavale wrote:
> 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@syzkaller.appspotmail.com
> Fixes: 7a7513292cc6 ("erofs: rename per-CPU buffers to global buffer pool and make it configurable")
> Signed-off-by: Sandeep Dhavale <dhavale@google.com>

Thanks for catching this, since the original patch is
for next upstream cycle, may I fold this fix in the
original patch?

I will add your credit into the original patch.

Thanks,
Gao Xiang

> ---
>   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)

  reply	other threads:[~2024-04-08 22:48 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-08 21:52 Sandeep Dhavale
2024-04-08 22:48 ` Gao Xiang [this message]
2024-04-08 23:05   ` Sandeep Dhavale
2024-04-08 23:20     ` Gao Xiang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3b3d0b99-f7b5-4dcc-a631-1018f4025acf@linux.alibaba.com \
    --to=hsiangkao@linux.alibaba.com \
    --cc=chao@kernel.org \
    --cc=dhavale@google.com \
    --cc=guochunhai@vivo.com \
    --cc=huyue2@coolpad.com \
    --cc=jefflexu@linux.alibaba.com \
    --cc=kernel-team@android.com \
    --cc=linux-erofs@lists.ozlabs.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=syzbot+27cc650ef45b379dfe5a@syzkaller.appspotmail.com \
    --cc=xiang@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®