Linux block layer
 help / color / mirror / Atom feed
From: Ming Lei <ming.lei@redhat.com>
To: Bart Van Assche <bvanassche@acm.org>
Cc: Jens Axboe <axboe@kernel.dk>,
	linux-block@vger.kernel.org, Christoph Hellwig <hch@lst.de>,
	Hannes Reinecke <hare@suse.de>, Omar Sandoval <osandov@fb.com>
Subject: Re: [PATCH] sbitmap: Fix sbitmap_put()
Date: Tue, 16 Mar 2021 14:35:30 +0800	[thread overview]
Message-ID: <YFBRsozJDW3kjxhv@T590> (raw)
In-Reply-To: <20210316035420.2584-1-bvanassche@acm.org>

On Mon, Mar 15, 2021 at 08:54:20PM -0700, Bart Van Assche wrote:
> This patch fixes the following kernel warning:
> 
> BUG: using smp_processor_id() in preemptible [00000000] code: scsi_eh_0/152
> caller is debug_smp_processor_id+0x17/0x20
> CPU: 1 PID: 152 Comm: scsi_eh_0 Tainted: G        W         5.12.0-rc1-dbg+ #6
> Call Trace:
>  show_stack+0x52/0x58
>  dump_stack+0xaf/0xf3
>  check_preemption_disabled+0xce/0xd0
>  debug_smp_processor_id+0x17/0x20
>  scsi_device_unbusy+0x13a/0x1c0 [scsi_mod]
>  scsi_finish_command+0x4d/0x290 [scsi_mod]
>  scsi_eh_flush_done_q+0x1e7/0x280 [scsi_mod]
>  ata_scsi_port_error_handler+0x592/0x750 [libata]
>  ata_scsi_error+0x1a0/0x1f0 [libata]
>  scsi_error_handler+0x19e/0x330 [scsi_mod]
>  kthread+0x222/0x250
>  ret_from_fork+0x1f/0x30
> 
> Cc: Ming Lei <ming.lei@redhat.com>
> Cc: Hannes Reinecke <hare@suse.de>
> Cc: Omar Sandoval <osandov@fb.com>
> Fixes: c548e62bcf6a ("scsi: sbitmap: Move allocation hint into sbitmap")
> Signed-off-by: Bart Van Assche <bvanassche@acm.org>
> ---
>  include/linux/sbitmap.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/linux/sbitmap.h b/include/linux/sbitmap.h
> index 3087e1f15fdd..2713e689ad66 100644
> --- a/include/linux/sbitmap.h
> +++ b/include/linux/sbitmap.h
> @@ -324,7 +324,7 @@ static inline void sbitmap_put(struct sbitmap *sb, unsigned int bitnr)
>  	sbitmap_deferred_clear_bit(sb, bitnr);
>  
>  	if (likely(sb->alloc_hint && !sb->round_robin && bitnr < sb->depth))
> -		*this_cpu_ptr(sb->alloc_hint) = bitnr;
> +		*raw_cpu_ptr(sb->alloc_hint) = bitnr;
>  }
>  
>  static inline int sbitmap_test_bit(struct sbitmap *sb, unsigned int bitnr)
> 

Reviewed-by: Ming Lei <ming.lei@redhat.com>

-- 
Ming


  reply	other threads:[~2021-03-16  6:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-16  3:54 [PATCH] sbitmap: Fix sbitmap_put() Bart Van Assche
2021-03-16  6:35 ` Ming Lei [this message]
2021-03-16 14:32 ` Jens Axboe
2021-03-16 19:37   ` Bart Van Assche

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=YFBRsozJDW3kjxhv@T590 \
    --to=ming.lei@redhat.com \
    --cc=axboe@kernel.dk \
    --cc=bvanassche@acm.org \
    --cc=hare@suse.de \
    --cc=hch@lst.de \
    --cc=linux-block@vger.kernel.org \
    --cc=osandov@fb.com \
    /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