From: Qu Wenruo <quwenruo.btrfs@gmx.com>
To: dsterba@suse.cz, Qu Wenruo <wqu@suse.com>,
linux-btrfs@vger.kernel.org,
Andrei Borzenkov <arvidjaar@gmail.com>
Subject: Re: [PATCH] btrfs: qgroup: Try our best to delete qgroup relations
Date: Tue, 6 Aug 2019 08:04:19 +0800 [thread overview]
Message-ID: <0f02d4fc-22ae-c4e7-44e8-5564e8724d73@gmx.com> (raw)
In-Reply-To: <20190805181356.GG28208@twin.jikos.cz>
[-- Attachment #1.1: Type: text/plain, Size: 1669 bytes --]
On 2019/8/6 上午2:13, David Sterba wrote:
> On Sat, Aug 03, 2019 at 02:45:59PM +0800, Qu Wenruo wrote:
>> When we try to delete qgroups, we're pretty cautious, we make sure both
>> qgroups exist and there is a relationship between them, then try to
>> delete the relation.
>>
>> This behavior is OK, but the problem is we need to two relation items,
>> and if we failed the first item deletion, we error out, leaving the
>> other relation item in qgroup tree.
>>
>> Sometimes the error from del_qgroup_relation_item() could just be
>> -ENOENT, thus we can ignore that error and continue without any problem.
>>
>> Further more, such cautious behavior makes qgroup relation deletion
>> impossible for orphan relation items.
>>
>> This patch will enhance __del_qgroup_relation():
>> - If both qgroups and their relation items exist
>> Go the regular deletion routine and update their accounting if needed.
>>
>> - If any qgroup or relation item doesn't exist
>> Then we still try to delete the orphan items anyway, but don't trigger
>> the accounting update.
>>
>> By this, we try our best to remove relation items, and can handle orphan
>> relation items properly, while still keep the existing behavior for good
>> qgroup tree.
>>
>> Reported-by: Andrei Borzenkov <arvidjaar@gmail.com>
>> Signed-off-by: Qu Wenruo <wqu@suse.com>
>
> Adding this to misc-next, please send a fstests testcase, thanks.
>
That's the problem, I haven't found how the orphan relationship item is
left over.
Latest kernel will already delete both of them if nothing wrong happened.
So no idea how to write one test case.
Thanks,
Qu
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
prev parent reply other threads:[~2019-08-06 0:04 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-03 6:45 [PATCH] btrfs: qgroup: Try our best to delete qgroup relations Qu Wenruo
2019-08-05 18:13 ` David Sterba
2019-08-06 0:04 ` Qu Wenruo [this message]
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=0f02d4fc-22ae-c4e7-44e8-5564e8724d73@gmx.com \
--to=quwenruo.btrfs@gmx.com \
--cc=arvidjaar@gmail.com \
--cc=dsterba@suse.cz \
--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;
as well as URLs for NNTP newsgroup(s).