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.

Re: [PATCH] btrfs-progs: Fix 2 extent buffer leak in btrfs-debug-tree.

2015-02-10 Thread Qu Wenruo
Original Message Subject: [PATCH] btrfs-progs: Fix 2 extent buffer leak in btrfs-debug-tree. From: Qu Wenruo quwen...@cn.fujitsu.com To: linux-btrfs@vger.kernel.org Date: 2015年02月11日 09:57 There are 2 known extent buffer: Oh, a small typo: 2 known extent buffer leak:, missing

RE: [PATCH v2] Btrfs: fix BUG_ON in btrfs_orphan_add() when delete unused block group

2015-02-10 Thread Zhao Lei
Hi, Liu Removing large amount of block group in a transaction may encounters BUG_ON() in btrfs_orphan_add(). That is becuase btrfs_orphan_reserve_metadata() Not big matter, s/becuase/because Thanks Zhaolei will grab metadata reservation from transaction handle, and

undeletable, lost and empty files

2015-02-10 Thread Leufke, Philipp M. (INT)
Good morning, these days I am encountering severe problems with at least two btrfs subvolumes of a raid1 volume. The problems started after a regular dist-upgrade on a machine running Ubuntu 14.04 with kernel 3.16.7-031607-generic. As maybe the following issue with Virtualbox (VB) is

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

2015-02-10 Thread Dongsheng Yang
Hi all, [1/9] is a RESEND with a reviewed-by. [2/9]-[6/9] are bug fixes about qgroup_inherit(), these patch make user can set the limits when creating a subvolume with the related patch in userspace applied. [7/9]-[8/9] are a cleanup for qgroup. [9/9] provides a way for btrfs-progs to get the

[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
There are two problems in qgroup: a). The PAGE_CACHE is 4K, even when we are writing a data of 1K, qgroup will reserve a 4K size. It will cause the last 3K in a qgroup is not available to user. b). When user is writing a inline data, qgroup will not reserve it, it means this is a window we can

[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

[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
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 in 2/4 and delete it in 4/4. Yes, I am glad to

[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
When we call btrfs_qgroup_inherit() with BTRFS_QGROUP_INHERIT_SET_LIMITS, btrfs will update the limit info of qgroup in btree but forget to update the qgroup in rbtree at the same time. It obviousely will cause an inconsistency. This patch fix it by updating the rbtree at the same time.

[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 a

[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

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

2015-02-10 Thread Dongsheng Yang
In function qgroup_excl_accounting(), we need to WARN when qg-excl is less than what we want to free, same to child and parents. But currently, for parent qgroup, the WARN_ON() is located after freeing qg-excl. It will WARN out even we free it normally. This patch move this WARN_ON() before

[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

[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

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

2015-02-10 Thread Dongsheng Yang
Although we have a type in each qgroup, the all qgroups are created in a default mode. This patch provide a method to user to specify the type of qgroup for a sub volume. It uses an unused byte in btrfs_ioctl_vol_args_v2 to pass a qgroup type from userspace to kernel. Then kernel can create a

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

2015-02-10 Thread Dongsheng Yang
Currenly, in data writing, -reserved is accounted in fill_delalloc(), but -may_use is released in clear_bit_hook() which is called by btrfs_finish_ordered_io(). That's too late, that said, between fill_delalloc() and btrfs_finish_ordered_io(), the data is doublely accounted by qgroup. It will

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

2015-02-10 Thread Dongsheng Yang
Currently, for pre_alloc or delay_alloc, the bytes will be accounted in space_info by the three guys. space_info-bytes_may_use --- space_info-reserved --- space_info-used. But on the other hand, in qgroup, there are only two counters to account the bytes, qgroup-reserved and qgroup-excl. And

[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
This patch provide a method to user to create a qgroup in a specified type. It use a byte of the -create in btrfs_ioctl_qgroup_create_args to pass the type of qgroup to kernel. Then there is a macro named as BTRFS_QGROUP_TYPE_SHIFT to help kernel get the type of qgroup user want to creat.

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

2015-02-10 Thread Dongsheng Yang
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...@github.com/yangdongsheng/linux.git qgroup_type

[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
This patch is introducing a *type* to btrfs_qgroup. Type could be data, metadata or both. data means this qgroup only care about the data size, metadata means this qgroup only care about the metadata size and both means this qgroup will care about data and metadata like what it was doing before

Re: [PATCH] btrfs-progs: fsck-test: Add check_sudo to check valid root/sudo privilege

2015-02-10 Thread David Sterba
On Mon, Feb 09, 2015 at 02:11:52PM +0800, Qu Wenruo wrote: Although fsck-test/012 uses sudo, it uses 'sudo -n', which won't prompt user to input password and will return 1 if no valid credential is found. And this makes test result quite annoying since it fails to mount and still continue,

Re: Repair broken btrfs raid6?

2015-02-10 Thread Tobias Holst
2015-02-10 8:17 GMT+01:00 Kai Krakow hurikha...@gmail.com: Tobias Holst to...@tobby.eu schrieb: and btrfs scrub status /[device] gives me the following output: scrub status for [UUID] scrub started at Mon Feb 9 18:16:38 2015 and was aborted after 2008 seconds total bytes scrubbed: 113.04GiB

Re: [PATCH 09/16] Btrfs-progs: Introduce metadump_v2

2015-02-10 Thread Josef Bacik
On 02/10/2015 02:14 PM, David Sterba wrote: On Mon, Feb 09, 2015 at 03:03:12PM -0500, Josef Bacik wrote: The METADUMP super flag makes us skip doing the chunk tree reading which isn't helpful for the new restore since we have a valid chunk tree. But we still want to have a way for the kernel

[PATCH v3] Btrfs: fix BUG_ON in btrfs_orphan_add() when delete unused block group

2015-02-10 Thread Forrest Liu
Removing large amount of block group in a transaction may encounters BUG_ON() in btrfs_orphan_add(). That is because btrfs_orphan_reserve_metadata() will grab metadata reservation from transaction handle, and btrfs_delete_unused_bgs() didn't reserve metadata for trnasaction handle when delete

Re: [PATCH] btrfs-progs: fsck-test: Add check_sudo to check valid root/sudo privilege

2015-02-10 Thread Qu Wenruo
Original Message Subject: Re: [PATCH] btrfs-progs: fsck-test: Add check_sudo to check valid root/sudo privilege From: David Sterba dste...@suse.cz To: Qu Wenruo quwen...@cn.fujitsu.com Date: 2015年02月10日 21:30 On Mon, Feb 09, 2015 at 02:11:52PM +0800, Qu Wenruo wrote:

Re: [PATCH v3 00/10] Enhance btrfs-find-root and open_ctree() to provide better chance on damaged btrfs.

2015-02-10 Thread Qu Wenruo
Original Message Subject: Re: [PATCH v3 00/10] Enhance btrfs-find-root and open_ctree() to provide better chance on damaged btrfs. From: David Sterba dste...@suse.cz To: Qu Wenruo quwen...@cn.fujitsu.com Date: 2015年02月10日 22:48 On Thu, Jan 29, 2015 at 05:07:15PM +0800, Qu

[PATCH] btrfs-progs: Move -rdynamic linker only option to LDFLAGS.

2015-02-10 Thread Qu Wenruo
Same thing as clang cleanup patch: commit 040b3f11ba6bd793a9ef79ed4d9032d22370 Author: Qu Wenruo quwen...@cn.fujitsu.com Date: Fri Dec 19 14:13:08 2014 +0800 btrfs-progs: Makefile: Move linker only option to LDFLAGS But the move to autoconfig seems using old Makefile. So do it again.