linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ritesh Harjani <riteshh@linux.ibm.com>
To: YueHaibing <yuehaibing@huawei.com>,
	linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org,
	tytso@mit.edu, adilger.kernel@dilger.ca
Subject: Re: [PATCH] ext4: mballoc: Disable preemption before getting per-CPU pointer
Date: Thu, 11 Jun 2020 06:51:14 +0530	[thread overview]
Message-ID: <20200611012114.CE7ECA4040@d06av23.portsmouth.uk.ibm.com> (raw)
In-Reply-To: <20200610134919.73688-1-yuehaibing@huawei.com>

Hello,

Fix for this is already submitted @

https://patchwork.ozlabs.org/project/linux-ext4/patch/534f275016296996f54ecf65168bb3392b6f653d.1591699601.git.riteshh@linux.ibm.com/

-ritesh

On 6/10/20 7:19 PM, YueHaibing wrote:
> BUG: using smp_processor_id() in preemptible [00000000] code: kworker/u16:3/2181
> caller is ext4_mb_new_blocks+0x388/0xed0
> CPU: 2 PID: 2181 Comm: kworker/u16:3 Not tainted 5.7.0+ #182
> Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS
> Workqueue: writeback wb_workfn (flush-8:0)
> Call Trace:
>   dump_stack+0xb9/0xfc
>   debug_smp_processor_id+0xc8/0xd0
>   ext4_mb_new_blocks+0x388/0xed0
>   ext4_ext_map_blocks+0xa92/0xff0
>   ext4_map_blocks+0x34e/0x580
>   ext4_writepages+0xa28/0x11b0
>   do_writepages+0x46/0xe0
>   __writeback_single_inode+0x5f/0x6b0
>   writeback_sb_inodes+0x290/0x620
>   __writeback_inodes_wb+0x62/0xb0
>   wb_writeback+0x36c/0x520
>   wb_workfn+0x319/0x680
>   process_one_work+0x271/0x640
>   worker_thread+0x3a/0x3a0
>   kthread+0x14e/0x170
>   ret_from_fork+0x27/0x40
> 
> Disable preemption before accessing discard_pa_seq.
> 
> Fixes: 07b5b8e1ac40 ("ext4: mballoc: introduce pcpu seqcnt for freeing PA to improve ENOSPC handling")
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> ---
>   fs/ext4/mballoc.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
> index a9083113a8c0..30b3bfb1e06a 100644
> --- a/fs/ext4/mballoc.c
> +++ b/fs/ext4/mballoc.c
> @@ -4708,7 +4708,8 @@ ext4_fsblk_t ext4_mb_new_blocks(handle_t *handle,
>   	}
>   
>   	ac->ac_op = EXT4_MB_HISTORY_PREALLOC;
> -	seq = *this_cpu_ptr(&discard_pa_seq);
> +	seq = *get_cpu_ptr(&discard_pa_seq);
> +	put_cpu_ptr(&discard_pa_seq);
>   	if (!ext4_mb_use_preallocated(ac)) {
>   		ac->ac_op = EXT4_MB_HISTORY_ALLOC;
>   		ext4_mb_normalize_request(ac, ar);
> 

      reply	other threads:[~2020-06-11  1:21 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-10 13:49 [PATCH] ext4: mballoc: Disable preemption before getting per-CPU pointer YueHaibing
2020-06-11  1:21 ` Ritesh Harjani [this message]

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=20200611012114.CE7ECA4040@d06av23.portsmouth.uk.ibm.com \
    --to=riteshh@linux.ibm.com \
    --cc=adilger.kernel@dilger.ca \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tytso@mit.edu \
    --cc=yuehaibing@huawei.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;
as well as URLs for NNTP newsgroup(s).