From: Christoph Hellwig <hch@lst.de>
To: Qu Wenruo <quwenruo.btrfs@gmx.com>
Cc: Christoph Hellwig <hch@lst.de>, Chris Mason <clm@fb.com>,
Josef Bacik <josef@toxicpanda.com>,
David Sterba <dsterba@suse.com>, Qu Wenruo <wqu@suse.com>,
linux-btrfs@vger.kernel.org
Subject: Re: [PATCH 5/8] btrfs: cleanup scrub_rbio
Date: Tue, 13 Dec 2022 14:24:33 +0100 [thread overview]
Message-ID: <20221213132433.GA21430@lst.de> (raw)
In-Reply-To: <083cd81a-644e-a054-80c1-1b3b902ff6e9@gmx.com>
On Tue, Dec 13, 2022 at 04:53:33PM +0800, Qu Wenruo wrote:
>> ret = scrub_assemble_read_bios(rbio, &bio_list);
>> if (ret < 0)
>> - goto cleanup;
>> + return ret;
>> submit_read_bios(rbio, &bio_list);
>> wait_event(rbio->io_wait, atomic_read(&rbio->stripes_pending) == 0);
>> /* We may have some failures, recover the failed sectors first. */
>> ret = recover_scrub_rbio(rbio);
>> - if (ret < 0)
>> - goto cleanup;
>> + if (ret < 0) {
>> + while ((bio = bio_list_pop(&bio_list)))
>> + bio_put(bio);
>> + return ret;
>> + }
>
> Do we still need the cleanup? IIRC after submit_read_bios() (or be more
> safe, after wait_event()), we should no longer touch @bio_list anymore.
Oh, true. submit_read_bios does the list_pop, so we don't need
this here, and in recover_rbio either. And looking at it a little more
I think the are could use even more cleanup by:
- moving the wait_event for stripes_pending into submit_read_bios.
- moving the submit_read_bios *_assemble_read_bios and stop passing
the bio_list entirely, which removes all the confusion about
who cleans it up.
What do you think of this series (still needs testing before I can
post it):
http://git.infradead.org/users/hch/misc.git/shortlog/refs/heads/btrfs-raid56-cleanups
next prev parent reply other threads:[~2022-12-13 13:24 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-13 8:41 small raid56 cleanups v2 Christoph Hellwig
2022-12-13 8:41 ` [PATCH 1/8] btrfs: cleanup raid56_parity_write Christoph Hellwig
2022-12-13 8:41 ` [PATCH 2/8] btrfs: cleanup rmw_rbio Christoph Hellwig
2022-12-13 8:41 ` [PATCH 3/8] btrfs: cleanup rmw_read_wait_recover Christoph Hellwig
2022-12-13 8:41 ` [PATCH 4/8] btrfs: cleanup recover_rbio Christoph Hellwig
2022-12-13 8:50 ` Qu Wenruo
2022-12-13 8:41 ` [PATCH 5/8] btrfs: cleanup scrub_rbio Christoph Hellwig
2022-12-13 8:53 ` Qu Wenruo
2022-12-13 13:24 ` Christoph Hellwig [this message]
2022-12-13 23:32 ` Qu Wenruo
2022-12-14 16:45 ` Christoph Hellwig
2022-12-13 8:41 ` [PATCH 6/8] btrfs: call rbio_orig_end_io from rmw_rbio Christoph Hellwig
2022-12-13 8:54 ` Qu Wenruo
2022-12-13 8:41 ` [PATCH 7/8] btrfs: call rbio_orig_end_io from recover_rbio Christoph Hellwig
2022-12-13 8:54 ` Qu Wenruo
2022-12-13 8:41 ` [PATCH 8/8] btrfs: call rbio_orig_end_io from scrub_rbio Christoph Hellwig
2022-12-13 8:55 ` Qu Wenruo
2022-12-13 8:59 ` small raid56 cleanups v2 Qu Wenruo
2022-12-13 13:25 ` Christoph Hellwig
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=20221213132433.GA21430@lst.de \
--to=hch@lst.de \
--cc=clm@fb.com \
--cc=dsterba@suse.com \
--cc=josef@toxicpanda.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=quwenruo.btrfs@gmx.com \
--cc=wqu@suse.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