linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Qu Wenruo <quwenruo.btrfs@gmx.com>
To: Andrei Borzenkov <arvidjaar@gmail.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 15:03:22 +0800	[thread overview]
Message-ID: <ce47beac-6470-a137-42c5-25ac4b104b97@gmx.com> (raw)
In-Reply-To: <5af7cf6f-50dc-7984-e030-e329622d4cec@gmail.com>


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



On 2019/8/3 下午2:49, Andrei Borzenkov wrote:
> 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?
> 

For creation, that's OK, as long as it's not using the deprecated copy
version..

Thanks,
Qu


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

      reply	other threads:[~2019-08-03  7:03 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
2019-08-03  7:03         ` 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=ce47beac-6470-a137-42c5-25ac4b104b97@gmx.com \
    --to=quwenruo.btrfs@gmx.com \
    --cc=arvidjaar@gmail.com \
    --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).