All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johannes Thumshirn <jthumshirn@suse.de>
To: Omar Sandoval <osandov@osandov.com>
Cc: linux-btrfs@vger.kernel.org, kernel-team@fb.com
Subject: Re: [PATCH 4/7] btrfs: don't prematurely free work in reada_start_machine_worker()
Date: Tue, 17 Sep 2019 14:09:48 +0200	[thread overview]
Message-ID: <20190917120948.GD12128@x250> (raw)
In-Reply-To: <15b3aebf569f2a2831bc852789935fae37798f8d.1568658527.git.osandov@fb.com>

On Mon, Sep 16, 2019 at 11:30:55AM -0700, Omar Sandoval wrote:
> From: Omar Sandoval <osandov@fb.com>
> 
> Currently, reada_start_machine_worker() frees the reada_machine_work and
> then calls __reada_start_machine() to do readahead. This is another
> potential instance of the bug in "btrfs: don't prematurely free work in
> run_ordered_work()".
> 
> There _might_ already be a deadlock here: reada_start_machine_worker()
> can depend on itself through stacked filesystems (__read_start_machine()
> -> reada_start_machine_dev() -> reada_tree_block_flagged() ->
> read_extent_buffer_pages() -> submit_one_bio() ->
> btree_submit_bio_hook() -> btrfs_map_bio() -> submit_stripe_bio() ->
> submit_bio() onto a loop device can trigger readahead on the lower
> filesystem).
> 
> Either way, let's fix it by freeing the work at the end.


Also remove the local fs_info variable as it got obsolete.

Anyways,
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
-- 
Johannes Thumshirn                            SUSE Labs Filesystems
jthumshirn@suse.de                                +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Mary Higgins, Sri Rasiah
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850

  reply	other threads:[~2019-09-17 12:09 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-16 18:30 [PATCH 0/7] btrfs: workqueue fixes+cleanups Omar Sandoval
2019-09-16 18:30 ` [PATCH 1/7] btrfs: get rid of unnecessary memset() of work item Omar Sandoval
2019-09-17 11:46   ` Johannes Thumshirn
2019-09-16 18:30 ` [PATCH 2/7] btrfs: don't prematurely free work in run_ordered_work() Omar Sandoval
2019-09-17 12:04   ` Johannes Thumshirn
2019-09-16 18:30 ` [PATCH 3/7] btrfs: don't prematurely free work in end_workqueue_fn() Omar Sandoval
2019-09-17 12:05   ` Johannes Thumshirn
2019-09-16 18:30 ` [PATCH 4/7] btrfs: don't prematurely free work in reada_start_machine_worker() Omar Sandoval
2019-09-17 12:09   ` Johannes Thumshirn [this message]
2019-09-16 18:30 ` [PATCH 5/7] btrfs: don't prematurely free work in scrub_missing_raid56_worker() Omar Sandoval
2019-09-17 12:10   ` Johannes Thumshirn
2019-09-16 18:30 ` [PATCH 6/7] btrfs: get rid of unique workqueue helper functions Omar Sandoval
2019-09-16 18:30 ` [PATCH 7/7] btrfs: get rid of pointless wtag variable in async-thread.c Omar Sandoval
2019-09-24 14:45 ` [PATCH 0/7] btrfs: workqueue fixes+cleanups David Sterba

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=20190917120948.GD12128@x250 \
    --to=jthumshirn@suse.de \
    --cc=kernel-team@fb.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=osandov@osandov.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.