[PATCH 2/2] btrfs-progs: qgroup limit: add a check for invalid input of 'T/G/M/K'

2015-06-03 Thread Dongsheng Yang
Add a check to error out in the following case: # ./btrfs qgroup limit T /mnt/ Invalid size argument given Without this patch, btrfs-progs would parse the input as 0 and continue. Signed-off-by: Dongsheng Yang yangds.f...@cn.fujitsu.com --- cmds-qgroup.c | 3 +++ 1 file changed, 3 insertions

[PATCH 1/2] btrfs-progs: qgroup: show 'none' when we did not limit it on this qgroup

2015-06-03 Thread Dongsheng Yang
excl max_rfer max_excl parent -- 0/5 2.19GiB 2.19GiB none none --- 0/257 100.02MiB100.02MiB none none --- Signed-off-by: Dongsheng Yang yangds.f...@cn.fujitsu.com

[PATCH 2/2] btrfs-progs: qgroup: allow user to clear some limitation on qgroup.

2015-06-03 Thread Dongsheng Yang
none none 0/257 100.02MiB100.02MiB none none Reported-by: Tsutomu Itoh t-i...@jp.fujitsu.com Signed-off-by: Dongsheng Yang yangds.f...@cn.fujitsu.com --- cmds-qgroup.c | 23 +++ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git

[PATCH] btrfs: qgroup: allow user to clear the limitation on qgroup

2015-06-03 Thread Dongsheng Yang
Currently, we can only set a limitation on a qgroup, but we can not clear it. This patch provide a choice to user to clear a limitation on qgroup by passing a value of CLEAR_VALUE(-1) to kernel. Reported-by: Tsutomu Itoh t-i...@jp.fujitsu.com Signed-off-by: Dongsheng Yang yangds.f

[PATCH 1/2] btrfs-progs: qgroup limit: error out if input value is negative

2015-06-03 Thread Dongsheng Yang
-by: Tsutomu Itoh t-i...@jp.fujitsu.com Signed-off-by: Dongsheng Yang yangds.f...@cn.fujitsu.com --- cmds-qgroup.c | 4 1 file changed, 4 insertions(+) diff --git a/cmds-qgroup.c b/cmds-qgroup.c index 00cc089..5ea4021 100644 --- a/cmds-qgroup.c +++ b/cmds-qgroup.c @@ -116,6 +116,10 @@ static int

[PATCH] xfstests: btrfs: 022: add a quota rescan -w to wait rescan finished.

2015-06-03 Thread Dongsheng Yang
-by: Dongsheng Yang yangds.f...@cn.fujitsu.com --- tests/btrfs/022 | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/btrfs/022 b/tests/btrfs/022 index 5c1a82d..56d4f3d 100755 --- a/tests/btrfs/022 +++ b/tests/btrfs/022 @@ -51,6 +51,7 @@ _basic_test() { _run_btrfs_util_prog subvolume create

Re: [PATCH] xfstests: btrfs: 022: add a quota rescan -w to wait rescan finished.

2015-06-03 Thread Dongsheng Yang
Hi Filip, Qu is off duty this week, would you please try this patch here? Thanx Yang On 06/03/2015 03:10 PM, Dongsheng Yang wrote: When we enable quota, btrfs will rescan quota numbers. We need to wait the rescan finished before any more operations on btrfs qgroups. Otherwith, the new btrfs

Re: [PATCH 2/2] btrfs-progs: qgroup: allow user to clear some limitation on qgroup.

2015-06-03 Thread Dongsheng Yang
On 06/03/2015 04:40 PM, Tsutomu Itoh wrote: On 2015/06/03 15:57, Dongsheng Yang wrote: Currently, we can not clear a limitation on a qgroup. Although there is a 'none' choice provided to user to do it, it does not work well. It does not set the flag which user want to clear, then kernel

[PATCH] Btrfs: fill -last_trans for delayed inode in btrfs_fill_inode.

2015-04-08 Thread Dongsheng Yang
, not recording the extents for it. Fix: This patch fill the -last_trans properly and set the runtime_flags if needed in this situation. Then we can get the log entries we expected after (6) and generic/311 passed. Signed-off-by: Dongsheng Yang yangds.f...@cn.fujitsu.com --- fs/btrfs/delayed

[PATCH 4/4] Btrfs-progs: qgroup: show specified quota data.

2015-03-19 Thread Dongsheng Yang
This patch allow user to choose the information type in command of qgroup show. Signed-off-by: Dongsheng Yang yangds.f...@cn.fujitsu.com --- cmds-qgroup.c | 24 +++- qgroup.c | 44 +++- qgroup.h | 7 ++- 3 files changed

[PATCH 3/7] Btrfs: qgroup: record and account ref for qgroup in different type.

2015-03-19 Thread Dongsheng Yang
This patch make the qgroup account the information of data or metadata by different infos. Signed-off-by: Dongsheng Yang yangds.f...@cn.fujitsu.com --- fs/btrfs/extent-tree.c| 48 + fs/btrfs/qgroup.c | 239 ++ fs/btrfs/qgroup.h

[PATCH 5/7] Btrfs: qgroup: update quota numbers in btrfs_qgroup_inherit.

2015-03-19 Thread Dongsheng Yang
Original, the all quota numbers are stored in data_info, but now, we store them separately in data_info and metadata_info. Then, when we create a snapshot and update the quota number, we need to update both of the data_info and metadata_info. Signed-off-by: Dongsheng Yang yangds.f

[PATCH 1/7] Btrfs: qgroup: split information and limits in qgroup to other structures.

2015-03-19 Thread Dongsheng Yang
| Then we can account data and metadata separately. And we can limit them separately. mixed_limits is provided to limit the sum of data and metadata. Signed-off-by: Dongsheng Yang yangds.f...@cn.fujitsu.com --- fs/btrfs/qgroup.c | 308

[PATCH 4/7] Btrfs: qgroup: update all infos and limits to disk.

2015-03-19 Thread Dongsheng Yang
There are not only one info for a qgroup, then we need to store the all infos and limits to disk. Signed-off-by: Dongsheng Yang yangds.f...@cn.fujitsu.com --- fs/btrfs/qgroup.c | 52 1 file changed, 40 insertions(+), 12 deletions(-) diff

[PATCH 7/7] Btrfs: qgroup: allow user to limit qgroup in different type.

2015-03-19 Thread Dongsheng Yang
at the same time. Signed-off-by: Dongsheng Yang yangds.f...@cn.fujitsu.com --- fs/btrfs/qgroup.c | 10 +++--- fs/btrfs/qgroup.h | 26 ++ 2 files changed, 33 insertions(+), 3 deletions(-) diff --git a/fs/btrfs/qgroup.c b/fs/btrfs/qgroup.c index bb98bdd..793c7bb 100644

[PATCH 0/7 V2] Btrfs: qgroup: part-4: Add type to btrfs qgroup.

2015-03-19 Thread Dongsheng Yang
10502144 1050214400 --- --- --MIXED info and limits After all, you can use btrfs-debug-tree tool to show the details for each items. Any comment or test are welcome !!! Thanx Yang Dongsheng Yang (7): Btrfs: qgroup: split information and limits

[PATCH 6/7] Btrfs: qgroup: account data and metadata separately in rescan.

2015-03-19 Thread Dongsheng Yang
So far, we can account quota number for data and metadata separately, but in quota resan, we have not implemented this feature. This patch make the rescan smart to distingush data and metadata and account them separately. Signed-off-by: Dongsheng Yang yangds.f...@cn.fujitsu.com --- fs/btrfs

[PATCH 2/7] Btrfs: qgroup: add incompatability feature for QGROUP_TYPE.

2015-03-19 Thread Dongsheng Yang
|qgroupid| similar for the limits. Signed-off-by: Dongsheng Yang yangds.f...@cn.fujitsu.com --- fs/btrfs/ctree.h | 20 ++- fs/btrfs/qgroup.c | 77

[PATCH 2/4] Btrfs-progs: qgroup: print info and limits type in btrfs-debug-tree.

2015-03-19 Thread Dongsheng Yang
We have restructured the btrfs_qgroup, and we are using objectid for btrfs_qgroup_info_item now. Then we need to print the objectid in btrfs-debug-tree. Signed-off-by: Dongsheng Yang yangds.f...@cn.fujitsu.com --- print-tree.c | 16 1 file changed, 16 insertions(+) diff --git

[PATCH 3/4] Btrfs-progs: qgroup: add a opt for type of qgroup limit.

2015-03-19 Thread Dongsheng Yang
This patch add a support for user to limit the data, metadata, or mixed of a qgroup. Even you can set these three limits at one time for a qgroup. Signed-off-by: Dongsheng Yang yangds.f...@cn.fujitsu.com --- cmds-qgroup.c | 48 +++- ioctl.h | 13

[PATCH 1/4] Btrfs-progs: qgroup: add incompatability feature for QGROUP_TYPE.

2015-03-19 Thread Dongsheng Yang
|BTRFS_QGROUP_INFO_KEY |qgroupid| Signed-off-by: Dongsheng Yang yangds.f...@cn.fujitsu.com --- ctree.h | 20 ++- mkfs.c | 2 + qgroup.c | 184

Re: [PATCH 3/3] btrfs: qgroup: fix a wrong parameter of no_quota.

2015-03-17 Thread Dongsheng Yang
Okey, I found a patch from Mark 35 weeks ago which was not merged into xfstest: [PATCH] xfstests/btrfs: add test for quota groups and drop snapshot It looks can answer my question here. Thanx Yang On Mon, Mar 16, 2015 at 12:59 PM, Dongsheng Yang yangds.f...@cn.fujitsu.com wrote: On 03/04/2015

Re: [RFC PATCH 0/7] Btrfs: qgroup: part-4: Add type to btrfs qgroup.

2015-03-17 Thread Dongsheng Yang
Hi all, I am cooking a V2 for this patchset, it will make user to limit data, metadata or mixed of a qgroup. Even, you can limit all of the three quota number at one time. I believe it's much better. Thanx. On 02/10/2015 06:24 PM, Dongsheng Yang wrote: Hi all, This patchset

[PATCH v2] fstest: btrfs: add a test for quota number when deleting a subvol.

2015-03-16 Thread Dongsheng Yang
This regression is introduced by two commits: e339a6b0 (Btrfs: __btrfs_mod_ref should always use no_quota) 1152651a (btrfs: qgroup: account shared subtrees during snapshot delete) Signed-off-by: Dongsheng Yang yangds.f...@cn.fujitsu.com --- changlog: v1: 1. Fix lots of coding

Re: [PATCH 3/3] btrfs: qgroup: fix a wrong parameter of no_quota.

2015-03-15 Thread Dongsheng Yang
On 03/04/2015 04:20 AM, Mark Fasheh wrote: On Tue, Mar 03, 2015 at 09:00:36AM -0500, Josef Bacik wrote: On 03/03/2015 06:18 AM, Dongsheng Yang wrote: On 02/26/2015 02:05 PM, Dongsheng Yang wrote: Wait a minute, this patch seems not working well in accounting quota number when deleting data

Re: [PATCH] fstest: btrfs: add a test for quota number when deleting a subvol.

2015-03-15 Thread Dongsheng Yang
Hi Guan, sorry for the late. On 03/06/2015 01:06 PM, Eryu Guan wrote: On Tue, Mar 03, 2015 at 07:13:30PM +0800, Dongsheng Yang wrote: This regression is introduced by two commits: e339a6b0 (Btrfs: __btrfs_mod_ref should always use no_quota) 1152651a (btrfs: qgroup: account shared subtrees

Re: [PATCH] fstest: btrfs: add a test for quota number when deleting a subvol.

2015-03-15 Thread Dongsheng Yang
On 03/16/2015 01:33 PM, Eryu Guan wrote: On Mon, Mar 16, 2015 at 01:06:52PM +0800, Dongsheng Yang wrote: Hi Guan, sorry for the late. On 03/06/2015 01:06 PM, Eryu Guan wrote: On Tue, Mar 03, 2015 at 07:13:30PM +0800, Dongsheng Yang wrote: This regression is introduced by two commits

Re: Quota limit question

2015-03-10 Thread Dongsheng Yang
Sorry about the late reply!! On 03/10/2015 04:41 PM, Qu Wenruo wrote: Original Message Subject: Re: Quota limit question From: Christian Robottom Reis k...@canonical.com To: Duncan 1i5t5.dun...@cox.net Date: 2015年03月07日 05:44 Just as a follow-up, I upgraded btrfs-tools

[PATCH v4 1/3] Btrfs: get more accurate output in df command.

2015-03-05 Thread Dongsheng Yang
== @Size as possible to user. Signed-off-by: Dongsheng Yang yangds.f...@cn.fujitsu.com --- v3-v4: Fix a trailing whitespace error found by checkpatch. fs/btrfs/ctree.h | 1 - fs/btrfs/extent-tree.c | 41 fs/btrfs/super.c | 72

[PATCH v3 1/3] Btrfs: get more accurate output in df command.

2015-03-04 Thread Dongsheng Yang
== @Size as possible to user. Signed-off-by: Dongsheng Yang yangds.f...@cn.fujitsu.com --- fs/btrfs/ctree.h | 1 - fs/btrfs/extent-tree.c | 41 fs/btrfs/super.c | 74 -- 3 files changed, 42 insertions(+), 74

[PATCH v3 2/3] Btrfs: raid56: simplify the parameter of nr_parity_stripes().

2015-03-04 Thread Dongsheng Yang
type. Then we can use it more easily. Signed-off-by: Dongsheng Yang yangds.f...@cn.fujitsu.com Reviewed-by: Satoru Takeuchi takeuchi_sat...@jp.fujitsu.com --- fs/btrfs/raid56.h | 8 fs/btrfs/volumes.c | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/fs/btrfs/raid56

[PATCH v3 0/3] Enhancement for df command.

2015-03-04 Thread Dongsheng Yang
Hi all, This is V3, just rebase it against 4.0-rc1. Any comment is welcome!! Thanx Dongsheng Yang (3): Btrfs: get more accurate output in df command. Btrfs: raid56: simplify the parameter of nr_parity_stripes(). Btrfs: adapt df command to RAID5/6. fs/btrfs/ctree.h | 1 - fs

[PATCH v3 3/3] Btrfs: adapt df command to RAID5/6.

2015-03-04 Thread Dongsheng Yang
1 size 2.00GiB used 1.85GiB path /dev/vdf1 devid2 size 4.00GiB used 1.83GiB path /dev/vdf2 Signed-off-by: Dongsheng Yang yangds.f...@cn.fujitsu.com --- fs/btrfs/super.c | 16 ++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/fs/btrfs/super.c b/fs/btrfs

[PATCH] fstest: btrfs: add a test for quota number when deleting a subvol.

2015-03-03 Thread Dongsheng Yang
This regression is introduced by two commits: e339a6b0 (Btrfs: __btrfs_mod_ref should always use no_quota) 1152651a (btrfs: qgroup: account shared subtrees during snapshot delete) Signed-off-by: Dongsheng Yang yangds.f...@cn.fujitsu.com --- tests/btrfs/084 | 84

Re: [PATCH 0/4] Btrfs: qgroup: part-2: bug fixes for qgroup reservation.

2015-03-03 Thread Dongsheng Yang
On 02/10/2015 06:23 PM, Dongsheng Yang wrote: Hi all, This is part2 for qgroup. It is based on [PATCH 0/9] Btrfs: qgroup: part-1: bug fixes. [1/4] is reviewed-by Josef. [2/4] - [4/4] are trying to solve a problem in qgroup reservation. It would be weired I introduce a may_use

Re: [RFC PATCH 0/7] Btrfs: qgroup: part-4: Add type to btrfs qgroup.

2015-03-03 Thread Dongsheng Yang
On 02/10/2015 06:24 PM, Dongsheng Yang wrote: Hi all, This patchset is based on [Btrfs: qgroup: part-3: bug fixes.] I am introducing a type to qgroup, then we can get the numbers what we only care about. Easy way to get the code for testing: btrfs: https://yangdongsh

Re: [PATCH 3/3] btrfs: qgroup: fix a wrong parameter of no_quota.

2015-03-03 Thread Dongsheng Yang
On 02/26/2015 02:05 PM, Dongsheng Yang wrote: Wait a minute, this patch seems not working well in accounting quota number when deleting data shared by different subvolumes. I will investigate more about it and send a V2 out. I have sent a fstest [PATCH] fstest: btrfs: add a test for quota

Re: [PATCH 3/3] btrfs: qgroup: fix a wrong parameter of no_quota.

2015-02-25 Thread Dongsheng Yang
Wait a minute, this patch seems not working well in accounting quota number when deleting data shared by different subvolumes. I will investigate more about it and send a V2 out. Thanx Yang On 02/13/2015 05:38 PM, Dongsheng Yang wrote:hen Hi Josef and Mark, I saw the commit message

Re: [PATCH 3/3] btrfs: qgroup: fix a wrong parameter of no_quota.

2015-02-13 Thread Dongsheng Yang
. To be honest, I am suspecting myself *very much*. I trust you guys and believe there must be something I am missing. Then I send this mail to ask your help. Thanx in advance. Yang On 02/10/2015 06:24 PM, Dongsheng Yang wrote: In function of __btrfs_mod_ref(), we are passing the no_quota=1

Re: [PATCH 3/3] btrfs: qgroup: fix a wrong parameter of no_quota.

2015-02-10 Thread Dongsheng Yang
On 02/10/2015 07:24 PM, Filipe David Manana wrote: On Tue, Feb 10, 2015 at 10:24 AM, Dongsheng Yang yangds.f...@cn.fujitsu.com wrote: In function of __btrfs_mod_ref(), we are passing the no_quota=1 to process_func() anyway. It will make the numbers in qgroup be wrong when deleting a subvolume

[PATCH 0/9] Btrfs: qgroup: part-1: bug fixes for qgroup inherit.

2015-02-10 Thread Dongsheng Yang
--- --- 0/25816.00KiB 16.00KiB 10.00MiB 5.00MiB --- --- Dongsheng Yang (8): btrfs: qgroup: move WARN_ON() to the correct location. btrfs: qgroup: inherit limit info from srcgroup in creating snapshot. btrfs: qgroup: update qgroup in memory at the same time when we

[PATCH 9/9] btrfs: qgroup: obtain quota status

2015-02-10 Thread Dongsheng Yang
From: Fan Chengniang fancn.f...@cn.fujitsu.com add a function to obtain quota status. Now it can only get whether quota is enabled. We can extend the function to get more quota status Signed-off-by: Fan Chengniang fancn.f...@cn.fujitsu.com --- fs/btrfs/ioctl.c | 6 ++

[PATCH 5/9] btrfs: qgroup: update limit info in function btrfs_run_qgroups().

2015-02-10 Thread Dongsheng Yang
When we commit_transaction(), qgroups in btree should be updated. But, limit info is not considered currently. It will cause a problem when a qgroup of a snapshot inherit the limit info from srcqgroup, then there is an inconsistency. Signed-off-by: Dongsheng Yang yangds.f...@cn.fujitsu.com

[PATCH 4/4] btrfs: qgroup: do a reservation in a higher level.

2015-02-10 Thread Dongsheng Yang
to write and release it in transaction committed. In this way, qgroup can be released from the complex procedure in btrfs and only do the reserve when user want to write and account when the data is written in commit_transaction(). Signed-off-by: Dongsheng Yang yangds.f...@cn.fujitsu.com --- fs

[PATCH 4/9] btrfs: qgroup: consolidate the parameter of fucntion update_qgroup_limit_item().

2015-02-10 Thread Dongsheng Yang
Cleanup: Change the parameter of update_qgroup_limit_item() to the family of update_qgroup_xxx_item(). Signed-off-by: Dongsheng Yang yangds.f...@cn.fujitsu.com --- fs/btrfs/qgroup.c | 51 --- 1 file changed, 24 insertions(+), 27 deletions(-) diff

[PATCH 1/2] btrfs-progs:correct the return value

2015-02-10 Thread Dongsheng Yang
From: Fan Chengniang fancn.f...@cn.fujitsu.com the return values 12 and 13 are not used spectially except as return value. No description and definition about them. so I change them to generic errno Signed-off-by: Fan Chengniang fancn.f...@cn.fujitsu.com --- qgroup.c | 7 --- 1 file

[PATCH 1/3] btrfs: qgroup: return EINVAL if level of parent is not higher than child's.

2015-02-10 Thread Dongsheng Yang
When we create a subvol inheriting a qgroup, we need to check the level of them. Otherwise, there is a chance a qgroup can inherit another qgroup at the same level. Signed-off-by: Dongsheng Yang yangds.f...@cn.fujitsu.com --- fs/btrfs/qgroup.c | 5 + 1 file changed, 5 insertions(+) diff

[PATCH 3/3] btrfs: qgroup: fix a wrong parameter of no_quota.

2015-02-10 Thread Dongsheng Yang
In function of __btrfs_mod_ref(), we are passing the no_quota=1 to process_func() anyway. It will make the numbers in qgroup be wrong when deleting a subvolume. The data size in a deleted subvolume will never be decressed from all related qgroups. Signed-off-by: Dongsheng Yang yangds.f

[PATCH 2/2] btrfs-progs:set max_rfer and max_excl on creating new subvolume

2015-02-10 Thread Dongsheng Yang
From: Fan Chengniang fancn.f...@cn.fujitsu.com add -r and -e options to enable setting max reference size and max exclusive on creating new subvolumes. Signed-off-by: Fan Chengniang fancn.f...@cn.fujitsu.com --- Documentation/btrfs-subvolume.txt | 8 +++- cmds-qgroup.c | 42

[PATCH 0/4] Btrfs: qgroup: part-2: bug fixes for qgroup reservation.

2015-02-10 Thread Dongsheng Yang
at different timing. When the all patches are reviewed by you guys, I am okey to squash them if you request. Thanx. Dongsheng Yang (4): Btrfs: qgroup: free reserved in exceeding quota. Btrfs: qgroup: Introduce a may_use to account space_info-bytes_may_use. Btrfs: qgroup, Account data space

[PATCH 3/9] btrfs: qgroup: update qgroup in memory at the same time when we update it in btree.

2015-02-10 Thread Dongsheng Yang
-off-by: Dongsheng Yang yangds.f...@cn.fujitsu.com --- fs/btrfs/qgroup.c | 28 +--- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/fs/btrfs/qgroup.c b/fs/btrfs/qgroup.c index b2cee33..1aae0c3 100644 --- a/fs/btrfs/qgroup.c +++ b/fs/btrfs/qgroup.c @@ -2230,17

[PATCH 8/9] Btrfs: qgroup: cleanup, remove an unsued parameter in btrfs_create_qgroup().

2015-02-10 Thread Dongsheng Yang
Signed-off-by: Dongsheng Yang yangds.f...@cn.fujitsu.com --- fs/btrfs/ioctl.c | 3 +-- fs/btrfs/qgroup.c | 2 +- fs/btrfs/qgroup.h | 3 +-- fs/btrfs/tests/qgroup-tests.c | 4 ++-- 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/fs/btrfs/ioctl.c

[PATCH 0/3] Btrfs: qgroup: part-3: bug fixes for deleting subvolume.

2015-02-10 Thread Dongsheng Yang
Hi all, This is a part3 for qgroup, it is based on Btrfs: qgroup: part-2: bug fixes. Dongsheng Yang (3): btrfs: qgroup: return EINVAL if level of parent is not higher than child's. btrfs: qgroup: allow to remove qgroup which has parent but no child. btrfs: qgroup: fix

[PATCH 2/9] btrfs: qgroup: inherit limit info from srcgroup in creating snapshot.

2015-02-10 Thread Dongsheng Yang
Currently, when we snapshot a subvol, snapshot will not copy the limits from srcqgroup. This patch make the qgroup in snapshot inherit the limit info when create a snapshot. Signed-off-by: Dongsheng Yang yangds.f...@cn.fujitsu.com --- fs/btrfs/qgroup.c | 8 1 file changed, 8 insertions

[PATCH 1/9] btrfs: qgroup: move WARN_ON() to the correct location.

2015-02-10 Thread Dongsheng Yang
freeing qg-excl. Signed-off-by: Dongsheng Yang yangds.f...@cn.fujitsu.com Reviewed-by: Satoru Takeuchi takeuchi_sat...@jp.fujitsu.com --- fs/btrfs/qgroup.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/btrfs/qgroup.c b/fs/btrfs/qgroup.c index 48b60db..97159a8 100644 --- a/fs

[PATCH 7/9] Btrfs: qgroup: make the btree for qgroup increase from left to right.

2015-02-10 Thread Dongsheng Yang
It's not a big deal, but I would rather make the btree follow the convention to increase from left to right. Signed-off-by: Dongsheng Yang yangds.f...@cn.fujitsu.com --- fs/btrfs/qgroup.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fs/btrfs/qgroup.c b/fs/btrfs

[PATCH 6/9] btrfs: qgroup: fix limit args override whole limit struct

2015-02-10 Thread Dongsheng Yang
btrfs_limit_group use arg limit to override the old qgroup_limit of corresponding qgroup. However, we should override part of old qgroup_limit according to the bit which has been set in arg limit. Signed-off-by: Fan Chengniang fancn.f...@cn.fujitsu.com Signed-off-by: Dongsheng Yang yangds.f

[PATCH 5/7] btrfs: qgroup: Apply qgroup type to subvol creating.

2015-02-10 Thread Dongsheng Yang
a qgroup with requested type to the subvolume. Signed-off-by: Dongsheng Yang yangds.f...@cn.fujitsu.com --- fs/btrfs/ioctl.c | 38 -- fs/btrfs/qgroup.c | 9 ++--- fs/btrfs/qgroup.h | 2 +- fs/btrfs/transaction.c | 2 +- include

[PATCH 3/4] Btrfs: qgroup, Account data space in more proper timings.

2015-02-10 Thread Dongsheng Yang
, the unexpected -EDQUOT will be killed. Reported-by: Satoru Takeuchi takeuchi_sat...@jp.fujitsu.com Signed-off-by: Dongsheng Yang yangds.f...@cn.fujitsu.com --- fs/btrfs/extent-tree.c | 16 +--- fs/btrfs/file.c| 9 - 2 files changed, 9 insertions(+), 16 deletions(-) diff

[PATCH 2/4] Btrfs: qgroup: Introduce a may_use to account space_info-bytes_may_use.

2015-02-10 Thread Dongsheng Yang
-by: Dongsheng Yang yangds.f...@cn.fujitsu.com --- fs/btrfs/extent-tree.c | 20 ++- fs/btrfs/inode.c | 18 - fs/btrfs/qgroup.c | 68 +++--- fs/btrfs/qgroup.h | 4 +++ 4 files changed, 104 insertions(+), 6 deletions

[PATCH 4/4] btrfs-progs:show qgroup type

2015-02-10 Thread Dongsheng Yang
From: Fan Chengniang fancn.f...@cn.fujitsu.com make 'btrfs qgroup show' command show qgroup type. Signed-off-by: Fan Chengniang fancn.f...@cn.fujitsu.com --- qgroup.c | 42 +++--- qgroup.h | 1 + 2 files changed, 40 insertions(+), 3 deletions(-) diff --git

[PATCH 3/4] btrfs-progs:specify qgroup type when creating qgroup

2015-02-10 Thread Dongsheng Yang
From: Fan Chengniang fancn.f...@cn.fujitsu.com add --qgroup-type option to specify qgroup type. Type can be metadata, data or mixed. Signed-off-by: Fan Chengniang fancn.f...@cn.fujitsu.com Signed-off-by: Dongsheng Yang yangds.f...@cn.fujitsu.com --- Documentation/btrfs-qgroup.txt | 5

[PATCH 3/7] btrfs: qgroup: Apply type to btrfs_qgroup_inherit().

2015-02-10 Thread Dongsheng Yang
Now, we have a type in each qgroup, then when we do a inherit(), we need to consider the type of qgroup to decide account metadata or not. Signed-off-by: Dongsheng Yang yangds.f...@cn.fujitsu.com --- fs/btrfs/qgroup.c | 18 ++ 1 file changed, 14 insertions(+), 4 deletions

[PATCH 4/7] btrfs: qgroup: Apply qgroup type to qgroup creating.

2015-02-10 Thread Dongsheng Yang
-off-by: Dongsheng Yang yangds.f...@cn.fujitsu.com --- fs/btrfs/ioctl.c | 12 ++-- fs/btrfs/qgroup.h | 6 ++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index a50f295..b1f46e8 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c

[RFC PATCH 0/7] Btrfs: qgroup: part-4: Add type to btrfs qgroup.

2015-02-10 Thread Dongsheng Yang
--- --- metadata,data 0/258 5242880 52428800 5242880 --- --- data --- excl == max_excl == data_size == 5M == 5242880 Dongsheng Yang (7): Btrfs: qgroup: Add type to btrfs_qgroup. btrfs: qgroup: apply type to the recording and accounting. btrfs: qgroup

[PATCH 2/4] btrfs-progs: specify qgroup type when creating subvolume

2015-02-10 Thread Dongsheng Yang
From: Fan Chengniang fancn.f...@cn.fujitsu.com add --qgroup-type option to specify qgroup type. Type can be metadata, data or all. Signed-off-by: Fan Chengniang fancn.f...@cn.fujitsu.com Signed-off-by: Dongsheng Yang yangds.f...@cn.fujitsu.com --- Documentation/btrfs-subvolume.txt | 4

[PATCH 6/7] btrfs: qgroup: apply type to quota rescan.

2015-02-10 Thread Dongsheng Yang
Although we have different type for each qgroup now, but the rescan is also working as before which is considering data and metadata both. This patch fix this problem. Signed-off-by: Dongsheng Yang yangds.f...@cn.fujitsu.com --- fs/btrfs/qgroup.c | 19 ++- 1 file changed, 14

[PATCH 1/7] Btrfs: qgroup: Add type to btrfs_qgroup.

2015-02-10 Thread Dongsheng Yang
size in a qgroup. Signed-off-by: Dongsheng Yang yangds.f...@cn.fujitsu.com --- fs/btrfs/ctree.h | 10 - fs/btrfs/ioctl.c | 3 ++- fs/btrfs/qgroup.c | 47 +++ fs/btrfs/qgroup.h | 12 ++- fs

Re: [PATCH 3/3] btrfs: qgroup: destroy related qgroup when removing subvolume if needed.

2015-01-22 Thread Dongsheng Yang
to deal with in this period, maybe the V2 will come a little late. Sorry about it. Thanx Yang Signed-off-by: Dongsheng Yang yangds.f...@cn.fujitsu.com --- fs/btrfs/inode.c | 4 fs/btrfs/qgroup.c | 1 - 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/fs/btrfs/inode.c b/fs/btrfs

[PATCH 3/3] btrfs: qgroup: destroy related qgroup when removing subvolume if needed.

2015-01-21 Thread Dongsheng Yang
When removing a subvol, if the related qgroup has no child qgroup, we should destroy it at the same time. Also remove the TODO entry in qgroup.c. Signed-off-by: Dongsheng Yang yangds.f...@cn.fujitsu.com --- fs/btrfs/inode.c | 4 fs/btrfs/qgroup.c | 1 - 2 files changed, 4 insertions(+), 1

[PATCH 2/3] btrfs: qgroup: allow user to remove qgroup which has parent but no child.

2015-01-21 Thread Dongsheng Yang
This patch remove the check of qgroup-parent in removing it. Signed-off-by: Dongsheng Yang yangds.f...@cn.fujitsu.com --- fs/btrfs/qgroup.c | 30 +- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/fs/btrfs/qgroup.c b/fs/btrfs/qgroup.c index c2983a4..c3b1e4f

Re: [PATCH] btrfs: get the accurate value of used_bytes in btrfs_get_block_group_info().

2015-01-07 Thread Dongsheng Yang
On 01/07/2015 05:22 PM, Qu Wenruo wrote: Hi Satoru-san Hi Dongsheng, On 2015/01/05 20:19, Dongsheng Yang wrote: Ping. IOCTL of BTRFS_IOC_SPACE_INFO currently does not report the data used but not synced to user. Then btrfs fi df will give user a wrong numbers before sync. This patch

Re: [PATCH v3 0/3] Btrfs: Enhancment for qgroup.

2015-01-07 Thread Dongsheng Yang
On 01/07/2015 08:49 AM, Satoru Takeuchi wrote: Hi Yang, On 2015/01/05 15:16, Dongsheng Yang wrote: Hi Josef and others, This patch set is about enhancing qgroup. [1/3]: fix a bug about qgroup leak when we exceed quota limit, It is reviewd by Josef. [2/3]: introduce a new accounter

[PATCH] btrfs: qgroup: move WARN_ON() to the correct location.

2015-01-06 Thread Dongsheng Yang
freeing qg-excl. Signed-off-by: Dongsheng Yang yangds.f...@cn.fujitsu.com --- fs/btrfs/qgroup.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/btrfs/qgroup.c b/fs/btrfs/qgroup.c index 48b60db..97159a8 100644 --- a/fs/btrfs/qgroup.c +++ b/fs/btrfs/qgroup.c @@ -1431,9 +1431,8

Re: Standards Problems [Was: [PATCH v2 1/3] Btrfs: get more accurate output in df command.]

2015-01-05 Thread Dongsheng Yang
On 12/31/2014 08:15 AM, Zygo Blaxell wrote: On Wed, Dec 17, 2014 at 08:07:27PM -0800, Robert White wrote: [...] There are a number of pathological examples in here, but I think there are justifiable correct answers for each of them that emerge from a single interpretation of the meanings of

Re: Standards Problems [Was: [PATCH v2 1/3] Btrfs: get more accurate output in df command.]

2015-01-05 Thread Dongsheng Yang
On 12/27/2014 09:10 AM, Robert White wrote: On 12/23/2014 04:31 AM, Dongsheng Yang wrote: On 12/18/2014 12:07 PM, Robert White wrote: ... Thanx Yang . xaE Fine. but you still haven't told me/us what you thing df (really fsstat() ) should report in those cases. Go back to that email

[PATCH v2 1/3] Btrfs: get more accurate output in df command.

2015-01-05 Thread Dongsheng Yang
== @Size as possible to user. Signed-off-by: Dongsheng Yang yangds.f...@cn.fujitsu.com --- Changelog: - account free space a block group by a block group, treat the block group in unexpected raid level as used. fs/btrfs/ctree.h | 1 - fs/btrfs/extent-tree.c | 41

[PATCH v2 2/3] Btrfs: raid56: simplify the parameter of nr_parity_stripes().

2015-01-05 Thread Dongsheng Yang
type. Then we can use it more easily. Signed-off-by: Dongsheng Yang yangds.f...@cn.fujitsu.com Reviewed-by: Satoru Takeuchi takeuchi_sat...@jp.fujitsu.com --- fs/btrfs/raid56.h | 8 fs/btrfs/volumes.c | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/fs/btrfs/raid56

Re: [PATCH] btrfs: get the accurate value of used_bytes in btrfs_get_block_group_info().

2015-01-05 Thread Dongsheng Yang
Ping. IOCTL of BTRFS_IOC_SPACE_INFO currently does not report the data used but not synced to user. Then btrfs fi df will give user a wrong numbers before sync. This patch solve this problem. On 10/27/2014 08:38 PM, Dongsheng Yang wrote: Reproducer: # mkfs.btrfs -f -b 20G /dev/sdb

Re: [PATCH] Fixing quota error when removing files from a limit exceeded subvols

2015-01-04 Thread Dongsheng Yang
in three modes, data, metadata and both. Then in this case if you only limit the size of data, you will not get a EQUOTA any more. Thanx Yang [root@algodev ~]# Best Regards, ~Khaled Ahmed On Jan 3, 2015, at 4:09 AM, Dongsheng Yang dongsheng081...@gmail.com wrote: Hi Khaled, Could you give use

[PATCH v3 0/3] Btrfs: Enhancment for qgroup.

2015-01-04 Thread Dongsheng Yang
of B/K/M/G to btrfs qgroup show. b). get the information via ioctl rather than reading it from btree. Will keep the old way as a fallback for compatiblity. Any comment and sugguestion is welcome. :) Yang Dongsheng Yang (3): Btrfs: qgroup: free reserved in exceeding quota. Btrfs: qgroup

[PATCH v3 3/3] Btrfs: qgroup, Account data space in more proper timings.

2015-01-04 Thread Dongsheng Yang
, the unexpected -EDQUOT will be killed. Reported-by: Satoru Takeuchi takeuchi_sat...@jp.fujitsu.com Signed-off-by: Dongsheng Yang yangds.f...@cn.fujitsu.com --- fs/btrfs/extent-tree.c | 16 +--- fs/btrfs/file.c| 9 - 2 files changed, 9 insertions(+), 16 deletions(-) diff

[PATCH v3 1/3] Btrfs: qgroup: free reserved in exceeding quota.

2015-01-04 Thread Dongsheng Yang
up. Signed-off-by: Dongsheng Yang yangds.f...@cn.fujitsu.com Reviewed-by: Josef Bacik jba...@fb.com --- fs/btrfs/extent-tree.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index a80b971..88b4e32 100644 --- a/fs/btrfs

Re: [PATCH] Fixing quota error when removing files from a limit exceeded subvols

2015-01-02 Thread Dongsheng Yang
Hi Khaled, Could you give use more description about the problem this patch is trying to solve? Maybe an example will help a lot to understand it. Thanx On Fri, Jan 2, 2015 at 7:48 AM, Khaled Ahmed khaled@gmail.com wrote: Signed-off-by: Khaled Ahmed khaled@gmail.com ---

Re: [PATCH v2 2/2] Btrfs: qgroup: Introduce a may_use to account space_info-bytes_may_use.

2014-12-27 Thread Dongsheng Yang
On Fri, Dec 26, 2014 at 1:43 PM, Satoru Takeuchi takeuchi_sat...@jp.fujitsu.com wrote: Hi Yang, On 2014/12/26 10:32, Dongsheng Yang wrote: Hi Satoru, I saw your mail of [BUG] Quota Ignored On write problem still exist with 3.16-rc5 http://news.gmane.org/find-root.php?message_id

Re: [PATCH v2 2/2] Btrfs: qgroup: Introduce a may_use to account space_info-bytes_may_use.

2014-12-25 Thread Dongsheng Yang
On 12/26/2014 01:43 PM, Satoru Takeuchi wrote: Hi Yang, On 2014/12/26 10:32, Dongsheng Yang wrote: Hi Satoru, I saw your mail of [BUG] Quota Ignored On write problem still exist with 3.16-rc5 http://news.gmane.org/find-root.php?message_id=53C8DEB0.1060404%40jp.fujitsu.com in gmane. I

Re: [PATCH v2 2/2] Btrfs: qgroup: Introduce a may_use to account space_info-bytes_may_use.

2014-12-25 Thread Dongsheng Yang
On 12/26/2014 02:49 PM, Dongsheng Yang wrote: On 12/26/2014 01:43 PM, Satoru Takeuchi wrote: Hi Yang, On 2014/12/26 10:32, Dongsheng Yang wrote: Hi Satoru, I saw your mail of [BUG] Quota Ignored On write problem still exist with 3.16-rc5 http://news.gmane.org/find-root.php?message_id

Re: Standards Problems [Was: [PATCH v2 1/3] Btrfs: get more accurate output in df command.]

2014-12-23 Thread Dongsheng Yang
On 12/18/2014 12:07 PM, Robert White wrote: I don't disagree with the _ideal_ of your patch. I just think that it's impossible to implement it without lying to the user or making things just as bad in a different way. I would _like_ you to be right. But my thing is finding and quantifying

Re: Standards Problems [Was: [PATCH v2 1/3] Btrfs: get more accurate output in df command.]

2014-12-17 Thread Dongsheng Yang
On 12/17/2014 03:52 AM, Robert White wrote: On 12/16/2014 03:30 AM, Dongsheng Yang wrote: Hi Robert, thanx for your proposal about this. IMHO, output of df command shoud be more friendly to user. Well, I think we have a disagreement on this point, let's take a look at what the zfs is doing

Re: Standards Problems [Was: [PATCH v2 1/3] Btrfs: get more accurate output in df command.]

2014-12-16 Thread Dongsheng Yang
On 12/16/2014 11:30 AM, Robert White wrote: On 12/15/2014 01:36 AM, Robert White wrote: So we don't just hand-wave over statfs(). We include the dev_item.bytes_excluded in the superblock and we decide once-and-for-all (with any geometry creation, or completed conversion) how many bytes just

Re: Standards Problems [Was: [PATCH v2 1/3] Btrfs: get more accurate output in df command.]

2014-12-16 Thread Dongsheng Yang
On Tue, Dec 16, 2014 at 7:30 PM, Dongsheng Yang yangds.f...@cn.fujitsu.com wrote: On 12/16/2014 11:30 AM, Robert White wrote: On 12/15/2014 01:36 AM, Robert White wrote: So we don't just hand-wave over statfs(). We include the dev_item.bytes_excluded in the superblock and we decide once

Re: [PATCH v2 1/3] Btrfs: get more accurate output in df command.

2014-12-16 Thread Dongsheng Yang
Hi Goffredo, On Tue, Dec 16, 2014 at 1:47 AM, Goffredo Baroncelli kreij...@inwind.it wrote: I Yang, On 12/14/2014 12:29 PM, Dongsheng Yang wrote: On Sat, Dec 13, 2014 at 3:25 AM, Goffredo Baroncelli kreij...@inwind.it wrote: On 12/11/2014 09:31 AM, Dongsheng Yang wrote: When function

Re: [PATCH v2 1/3] Btrfs: get more accurate output in df command.

2014-12-15 Thread Dongsheng Yang
On 12/15/2014 03:49 PM, Robert White wrote: On 12/14/2014 10:06 PM, Robert White wrote: On 12/14/2014 05:21 PM, Dongsheng Yang wrote: Anyone have some suggestion about it? (... strong advocacy for raw numbers...) Hi Robert, thanx for your so detailed reply. You are proposing to report

Re: [PATCH v2 1/3] Btrfs: get more accurate output in df command.

2014-12-14 Thread Dongsheng Yang
On Sat, Dec 13, 2014 at 3:25 AM, Goffredo Baroncelli kreij...@inwind.it wrote: On 12/11/2014 09:31 AM, Dongsheng Yang wrote: When function btrfs_statfs() calculate the tatol size of fs, it is calculating the total size of disks and then dividing it by a factor. But in some usecase

Re: [PATCH v2 1/3] Btrfs: get more accurate output in df command.

2014-12-14 Thread Dongsheng Yang
on one device, and anything used by the file system and user should go to the used space. Am I missing something here? Thanks, Grzegorz On Sun, Dec 14, 2014 at 9:29 AM, Dongsheng Yang dongsheng081...@gmail.com wrote: On Sat, Dec 13, 2014 at 3:25 AM, Goffredo Baroncelli kreij...@inwind.it wrote

Re: [PATCH v2 1/3] Btrfs: get more accurate output in df command.

2014-12-13 Thread Dongsheng Yang
On 12/13/2014 02:00 AM, Goffredo Baroncelli wrote: On 12/11/2014 09:31 AM, Dongsheng Yang wrote: When function btrfs_statfs() calculate the tatol size of fs, it is calculating the total size of disks and then dividing it by a factor. But in some usecase, the result is not good to user. I am

Re: [PATCH v2 1/3] Btrfs: get more accurate output in df command.

2014-12-13 Thread Dongsheng Yang
On 12/13/2014 08:50 AM, Duncan wrote: Goffredo Baroncelli posted on Fri, 12 Dec 2014 19:00:20 +0100 as excerpted: $ sudo ./btrfs fi df /mnt/btrfs1/ Data, RAID1: total=1.00GiB, used=512.00KiB Data, single: total=8.00MiB, used=0.00B System, RAID1: total=8.00MiB, used=16.00KiB System, single:

[PATCH v2 2/2] Btrfs: qgroup: Introduce a may_use to account space_info-bytes_may_use.

2014-12-12 Thread Dongsheng Yang
-by: Dongsheng Yang yangds.f...@cn.fujitsu.com --- Changelog: v1 - v2: Remove the redundant check for fs_info-quota_enabled. fs/btrfs/extent-tree.c | 20 ++- fs/btrfs/inode.c | 18 - fs/btrfs/qgroup.c | 68

[PATCH v2 1/2] Btrfs: qgroup: free reserved in exceeding quota.

2014-12-12 Thread Dongsheng Yang
up. Signed-off-by: Dongsheng Yang yangds.f...@cn.fujitsu.com Reviewed-by: Josef Bacik jba...@fb.com --- fs/btrfs/extent-tree.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index a84e00d..014b7f2 100644 --- a/fs/btrfs

Re: [PATCH] Btrfs: get more accurate output in fd command.

2014-12-11 Thread Dongsheng Yang
On 12/11/2014 03:05 AM, Goffredo Baroncelli wrote: On 12/10/2014 04:02 PM, Dongsheng Yang wrote: On Wed, Dec 10, 2014 at 9:21 PM, Duncan 1i5t5.dun...@cox.net wrote: Robert White posted on Wed, 10 Dec 2014 02:53:40 -0800 as excerpted: [...] And in the example, the mkfs was supplied with two

  1   2   >