From: Jeff Mahoney <jeffm@suse.com>
To: dsterba@suse.cz, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH 1/3] btrfs: qgroups, fix rescan worker running races
Date: Wed, 2 May 2018 09:58:29 -0400 [thread overview]
Message-ID: <504675d4-2a5c-2972-afd7-17dfdad71845@suse.com> (raw)
In-Reply-To: <20180502131543.GY21272@twin.jikos.cz>
On 5/2/18 9:15 AM, David Sterba wrote:
> On Wed, May 02, 2018 at 12:29:28PM +0200, David Sterba wrote:
>> On Thu, Apr 26, 2018 at 03:23:49PM -0400, jeffm@suse.com wrote:
>>> From: Jeff Mahoney <jeffm@suse.com>
>>> +static void queue_rescan_worker(struct btrfs_fs_info *fs_info)
>>> +{
>>> + mutex_lock(&fs_info->qgroup_rescan_lock);
>>> + if (btrfs_fs_closing(fs_info)) {
>>> + mutex_unlock(&fs_info->qgroup_rescan_lock);
>>> + return;
>>> + }
>>> + if (WARN_ON(fs_info->qgroup_rescan_running)) {
>>
>> The warning is quite noisy, I see it after tests btrfs/ 017, 022, 124,
>> 139, 153. Is it necessary for non-debugging builds?
>>
>> The tested branch was full for-next so it could be your patchset
>> interacting with other fixes, but the warning noise level question still
>> stands.
>
> So it must be something with the rest of misc-next or for-next patches,
> current for 4.17 queue does show the warning at all, and the patch is ok
> for merge.
>
You might have something that causes it to be more noisy but it looks
like it should be possible to hit on 4.16. The warning is supposed to
detect and complain about multiple rescan threads starting. What I
think it's doing here is (correctly) identifying a different race: at
the end of btrfs_qgroup_rescan_worker, we clear the rescan status flag,
drop the lock, commit the status item transaction, and then update
->qgroup_rescan_running. If a rescan is requested before the lock is
reacquired, we'll try to start it up and then hit that warning.
So, the warning is doing its job. Please hold off on merging this patch.
IMO the root cause is overloading fs_info->qgroup_flags to correspond to
the on-disk item and control runtime behavior. I've been meaning to fix
that for a while, so I'll do that now.
-Jeff
--
Jeff Mahoney
SUSE Labs
next prev parent reply other threads:[~2018-05-02 13:58 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-26 19:23 [PATCH 1/3] btrfs: qgroups, fix rescan worker running races jeffm
2018-04-26 19:23 ` [PATCH 2/3] btrfs: qgroups, remove unnecessary memset before btrfs_init_work jeffm
2018-04-26 20:37 ` Nikolay Borisov
2018-04-26 19:23 ` [PATCH 3/3] btrfs: qgroup, don't try to insert status item after ENOMEM in rescan worker jeffm
2018-04-26 20:39 ` Nikolay Borisov
2018-04-27 15:44 ` David Sterba
2018-04-27 16:08 ` Jeff Mahoney
2018-04-27 16:11 ` [PATCH v2] " Jeff Mahoney
2018-04-27 16:34 ` David Sterba
2018-04-27 8:42 ` [PATCH 1/3] btrfs: qgroups, fix rescan worker running races Nikolay Borisov
2018-04-27 8:48 ` Filipe Manana
2018-04-27 16:00 ` Jeff Mahoney
2018-04-27 15:56 ` David Sterba
2018-04-27 16:02 ` Jeff Mahoney
2018-04-27 16:40 ` David Sterba
2018-04-27 19:32 ` Jeff Mahoney
2018-04-28 17:09 ` David Sterba
2018-04-27 19:28 ` Noah Massey
2018-04-28 17:10 ` David Sterba
2018-04-30 6:20 ` Qu Wenruo
2018-04-30 14:07 ` Jeff Mahoney
2018-05-02 10:29 ` David Sterba
2018-05-02 13:15 ` David Sterba
2018-05-02 13:58 ` Jeff Mahoney [this message]
-- strict thread matches above, loose matches on Subject: below --
2018-05-02 21:11 [PATCH v3 0/3] btrfs: qgroup rescan races (part 1) jeffm
2018-05-02 21:11 ` [PATCH 1/3] btrfs: qgroups, fix rescan worker running races jeffm
2018-05-03 7:24 ` Nikolay Borisov
2018-05-03 13:39 ` Jeff Mahoney
2018-05-03 15:52 ` Nikolay Borisov
2018-05-03 15:57 ` Jeff Mahoney
2018-05-10 19:49 ` Jeff Mahoney
2018-05-10 23:04 ` Jeff Mahoney
2020-01-16 6:41 ` 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=504675d4-2a5c-2972-afd7-17dfdad71845@suse.com \
--to=jeffm@suse.com \
--cc=dsterba@suse.cz \
--cc=linux-btrfs@vger.kernel.org \
/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).