From: Andrei Borzenkov <arvidjaar@gmail.com>
To: Qu Wenruo <quwenruo.btrfs@gmx.com>,
"linux-btrfs@vger.kernel.org" <linux-btrfs@vger.kernel.org>
Subject: Re: Non-existent qgroup in parent-child relation prevents makes qgroup commands fail
Date: Sat, 3 Aug 2019 09:49:26 +0300 [thread overview]
Message-ID: <5af7cf6f-50dc-7984-e030-e329622d4cec@gmail.com> (raw)
In-Reply-To: <677ae3d7-10d8-9073-e5d3-e38de65da9ee@gmx.com>
[-- Attachment #1.1: Type: text/plain, Size: 1907 bytes --]
03.08.2019 9:17, Qu Wenruo пишет:
>
>
> On 2019/8/3 下午1:31, Andrei Borzenkov wrote:
>> 03.08.2019 2:09, Qu Wenruo пишет:
>>>
>>>
>>> On 2019/8/3 上午2:08, Andrei Borzenkov wrote:
>>>> bor@tw:~> sudo btrfs qgroup show .
>>>> ERROR: cannot find the qgroup 0/789
>>>> bor@tw:~>
>>>>
>>>> Fine. This openSUSE with snapper which creates and automatically
>>>> destroys snapshots and apparently either kernel or snapper now also
>>>> remove corresponding qgroup. I played with snapshots and created several
>>>> top level qgroups that included snapshot qgroups existing at this time.
>>>> Now these snapshots are gone, their qgroups are gone ...
>>>
>>> Kernel version please.
>>>
>>> IIRC latest upstream kernel doesn't remove the level 0 qgroup.
>>
>> Yes?
>>
>>> It may be the userspace doing it improperly.
>>>
>>
>> Not sure what "improperly" means here. snapper removes qgroup after
>> deleting snapshot. What is "improper" here?
>
> Doing without using the qgroup ioctl, but some extra flag in snapshot
> creation/deletion, which can also add relation at subv/snapshot creation
> time.
>
As far as I can tell, this is exactly what snapper does:
if (qgroup != no_qgroup)
{
size_t size = sizeof(btrfs_qgroup_inherit) +
sizeof(((btrfs_qgroup_inherit*) 0)->qgroups[0]);
vector<char> buffer(size, 0);
struct btrfs_qgroup_inherit* inherit =
(btrfs_qgroup_inherit*) &buffer[0];
inherit->num_qgroups = 1;
inherit->num_ref_copies = 0;
inherit->num_excl_copies = 0;
inherit->qgroups[0] = qgroup;
args_v2.flags |= BTRFS_SUBVOL_QGROUP_INHERIT;
args_v2.size = size;
args_v2.qgroup_inherit = inherit;
}
Do you say it should not be doing it?
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
next prev parent reply other threads:[~2019-08-03 6:49 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-02 18:08 Non-existent qgroup in parent-child relation prevents makes qgroup commands fail Andrei Borzenkov
2019-08-02 23:09 ` Qu Wenruo
2019-08-03 5:31 ` Andrei Borzenkov
2019-08-03 6:17 ` Qu Wenruo
2019-08-03 6:49 ` Andrei Borzenkov [this message]
2019-08-03 7:03 ` 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=5af7cf6f-50dc-7984-e030-e329622d4cec@gmail.com \
--to=arvidjaar@gmail.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=quwenruo.btrfs@gmx.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).