All of lore.kernel.org
 help / color / mirror / Atom feed
From: Qu Wenruo <quwenruo.btrfs@gmx.com>
To: fdmanana@gmail.com
Cc: Qu Wenruo <wqu@suse.com>,
	linux-btrfs <linux-btrfs@vger.kernel.org>,
	Filipe Manana <fdmanana@suse.com>
Subject: Re: [PATCH] btrfs: scrub: Require mandatory block group RO for dev-replace
Date: Thu, 23 Jan 2020 21:57:53 +0800	[thread overview]
Message-ID: <e2002d7e-daba-9fcb-0442-2feddfa7ec30@gmx.com> (raw)
In-Reply-To: <CAL3q7H5NudsNQZo+W1mJ26VxFTrowpqAH7soE0j3F2GTygae8w@mail.gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 977 bytes --]



On 2020/1/23 下午9:49, Filipe Manana wrote:
[...]
>> This btrfs_wait_nocow_writers() is not just triggering ordered extents
>> for nocow.
>> It waits for the nocow_writers count decreased to 0 for that block group.
>>
>> Since we have already marked the block group RO, no new nocow writers
>> can happen, thus that counter can only decrease, no way to increase.
>>
>> There are several cases involved:
>> - NoCOW Write back happens before bg RO
>>   It will increase cache->nocow_writers counter, and decrease the
>>   counter after finish_oredered_io().
> 
> Nop. nocow_writers is decremented after creating the ordered extent
> when starting writeback (at run_delalloc_nocow) - not when completing
> the ordered extent (at btrfs_finish_ordered_io()).

Oh, right. The dec part still happens in run_delalloc_nocow().
So the wait_ordered_roots() call is still needed.

Thanks,
Qu

> Same applies direct IO.
> 
> Thanks
> 

>>>
>>
> 
> 


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2020-01-23 13:58 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-23  7:37 [PATCH] btrfs: scrub: Require mandatory block group RO for dev-replace Qu Wenruo
2020-01-23 12:06 ` Filipe Manana
2020-01-23 12:28   ` Qu WenRuo
2020-01-23 13:39   ` Qu Wenruo
2020-01-23 13:49     ` Filipe Manana
2020-01-23 13:57       ` Qu Wenruo [this message]
2020-01-23 16:40 ` David Sterba
2020-01-23 23:58   ` Qu Wenruo
  -- strict thread matches above, loose matches on Subject: below --
2020-01-23 23:58 Qu Wenruo
2020-01-24  9:24 ` Filipe Manana
2020-01-24 13:40   ` David Sterba
2020-01-24 14:44 ` David Sterba
2020-01-24 16:28   ` Filipe Manana
2020-01-25  0:36     ` Qu Wenruo
2020-01-25  0:48       ` Qu Wenruo
2020-01-25 11:35       ` David Sterba
2020-01-25 12:09         ` Qu WenRuo

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=e2002d7e-daba-9fcb-0442-2feddfa7ec30@gmx.com \
    --to=quwenruo.btrfs@gmx.com \
    --cc=fdmanana@gmail.com \
    --cc=fdmanana@suse.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 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.