Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: Qu Wenruo <quwenruo.btrfs@gmx.com>
To: Johannes Thumshirn <Johannes.Thumshirn@wdc.com>,
	Qu Wenruo <wqu@suse.com>,
	"linux-btrfs@vger.kernel.org" <linux-btrfs@vger.kernel.org>
Subject: Re: [PATCH 1/2] btrfs: fix wild pointer access during metadata read failure for subpage
Date: Mon, 15 Mar 2021 16:25:32 +0800	[thread overview]
Message-ID: <f4ebad22-2004-b051-2871-8f1ed64cc6cc@gmx.com> (raw)
In-Reply-To: <PH0PR04MB741641D5C56FD335C864FD0B9B6C9@PH0PR04MB7416.namprd04.prod.outlook.com>



On 2021/3/15 下午3:55, Johannes Thumshirn wrote:
> On 15/03/2021 06:40, Qu Wenruo wrote:
>> The difference against find_extent_buffer_nospinlock() is:
>> - Also handles regular sectorsize == PAGE_SIZE case
>> - No extent buffer refs increase/decrease
>>    As extent buffer under IO must has non-zero refs.
>
> Can these be merged into a single function? The sectorsie == PAGE_SIZE case
> won't do anything for find_extent_buffer_nospinlock() and the
> atomic_inc_not_zero(&eb->refs) can be hidden behind a 'if (write)' check.

That would make the eb refs change too inconsistent.

But I get your point.

How about calling find_extent_buffer_nospinlock() and then dec the refs
manually?

Thanks,
Qu

>
> Note, I was looking at this version:
> https://www.spinics.net/lists/linux-btrfs/msg111188.html
>

  reply	other threads:[~2021-03-15  8:26 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-15  5:39 [PATCH 0/2] btrfs: fixes for subpage which also affect read-only mount Qu Wenruo
2021-03-15  5:39 ` [PATCH 1/2] btrfs: fix wild pointer access during metadata read failure for subpage Qu Wenruo
2021-03-15  7:55   ` Johannes Thumshirn
2021-03-15  8:25     ` Qu Wenruo [this message]
2021-03-15 18:51       ` David Sterba
2021-03-16  0:03         ` Qu Wenruo
2021-03-15  5:39 ` [PATCH 2/2] btrfs: make reada to be subpage compatible Qu Wenruo
2021-03-15  9:39   ` Johannes Thumshirn
2021-03-15 15:42 ` [PATCH 0/2] btrfs: fixes for subpage which also affect read-only mount David Sterba
2021-03-16  0:29   ` Qu Wenruo
2021-03-16 10:08     ` David Sterba
2021-03-16 10:15 ` 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=f4ebad22-2004-b051-2871-8f1ed64cc6cc@gmx.com \
    --to=quwenruo.btrfs@gmx.com \
    --cc=Johannes.Thumshirn@wdc.com \
    --cc=linux-btrfs@vger.kernel.org \
    --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