linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arne Jansen <sensille@gmx.net>
To: Wang Shilong <wangshilong1991@gmail.com>
Cc: "linux-btrfs@vger.kernel.org" <linux-btrfs@vger.kernel.org>
Subject: Re: about btrfs quota issues
Date: Mon, 11 Mar 2013 14:38:33 +0100	[thread overview]
Message-ID: <513DDE59.6030804@gmx.net> (raw)
In-Reply-To: <5CEDCD84-0030-4AD1-A470-1F176D1D9CC5@gmail.com>

On 11.03.2013 14:31, Wang Shilong wrote:
> 
> Hello,
> 
<snip>

>>>
>>> In fact, i think you try to put some work on users, especially when
>>> snapshot happens.
>>> It is complex to track all the group's accounting when having
>>> snapshots..See the following
>>> commands.
>>>
>>> btrfs sub snapshot -c src_qgroupid:dst_qgroupid  <mnt>
>>> btrfs sub snapshot  -x src_qgroupid:dst_qgroupid <mnt>
>>>
>>>
>>> Are these commands designed for some cases regarding to
>>> snapshots/subvolume cases?
>>
>> Yes, these commands would have helped you in the above case. You need to
>> create an empty qgroup and copy the exclusive from there on snapshot
>> creation.
> 
> I am wondering why we need the concept of exclusive.
> Maybe it helps to some extent
> 

It is needed to answer the question 'how many space can I gain but
deleting this subvol or this set of subvolumes?'

> How about just  kicking it off, since the concepts of exclusive
> adds the complexity of btrfs quota.

If you don't need that value, just ignore the tracking error.

> 
> The worst thing is that i don't think users can master this magic
> concept very well.

Normally users don't need very sophisticated scenarios. In fact, they
don't even need higher level quota groups, the basic tracking is
enough. In this case, everything just works as expected for the user.
If you start creating and assigning qgroups manually, prepare to handle
the complexity.

-Arne

> 
>>
>>> If so, i think it really confusing and too complex for users to do
>>> such work, is't it?...
>>
>> It is complex. That is why I always point anyone asking to do some work
>> on btrfs or qgroups to writing an enhanced interface to simplify this
>> task for the user. I don't think the kernel should handle this.
>> And that's why I took the effort to write a pdf to explain the
>> concepts :)
> 
> I don't have any  good ideas about this yet..
> 
>> But the current interface is not only complex, it also is very powerful.
>> You can solve problems with it that no other quota system I know of can
>> solve.
>>
>>>
>>> BTW, i have a question about the function btrfs_qgroup_inherit(),
>>> when copying exclusive value from src_qgroup to dst_qgroup:
>>>
>>>       dst_qgroup->exclusive = src_qgroup->exclusive + level_size
>>>
>>> while copying referenced value from src_qgroup to dot_qgroup:
>>>
>>>       dst_qgroup->referenced = src_qgroup->referenced -level_size
>>>
>>> I can't really figure out...~_~
>>
>> level_size is just a small correction for the space the tree root
>> occupies. The tree root is never shared between sub volumes.
> 
> O.K. I  got it..
> 
> Thanks,
> Wang
> 
>>
>> -Arne
>>
>>>
>>> Thanks,
>>> Wang
>>
> 


  reply	other threads:[~2013-03-11 13:38 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-10  4:21 about btrfs quota issues Shilong Wang
2013-03-11 11:04 ` Wang Shilong
2013-03-11 13:16 ` Arne Jansen
2013-03-11 13:31   ` Wang Shilong
2013-03-11 13:38     ` Arne Jansen [this message]
2013-03-11 14:15       ` Wang Shilong
2013-03-11 14:21         ` Arne Jansen
2013-03-11 14:35           ` Wang Shilong
2013-03-11 14:45             ` Arne Jansen
  -- strict thread matches above, loose matches on Subject: below --
2013-03-11 14:59 Wang

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=513DDE59.6030804@gmx.net \
    --to=sensille@gmx.net \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=wangshilong1991@gmail.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).