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 unuse
On 02/10/2015 07:24 PM, Filipe David Manana wrote:
On Tue, Feb 10, 2015 at 10:24 AM, Dongsheng Yang
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. The data size in a deleted
Original Message
Subject: [PATCH] btrfs-progs: Fix 2 extent buffer leak in btrfs-debug-tree.
From: Qu Wenruo
To:
Date: 2015年02月11日 09:57
There are 2 known extent buffer:
Oh, a small typo: "2 known extent buffer leak:", missing the word leak.
1) With -t option.
-t option wil
There are 2 known extent buffer:
1) With -t option.
-t option will skip other tree roots, but it will read the root node
first and then skip it.
Where it forgets to free the tree block it read.
2) with -b option.
It forgets to free the tree block it read.
Signed-off-by: Qu Wenruo
---
btrfs-debu
Same thing as clang cleanup patch:
commit 040b3f11ba6bd793a9ef79ed4d9032d22370
Author: Qu Wenruo
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.
Signed-off-by: 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
To: Qu Wenruo
Date: 2015年02月10日 22:48
On Thu, Jan 29, 2015 at 05:07:15PM +0800, Qu Wenruo wrote:
Also, since only 2 patches
Original Message
Subject: Re: [PATCH] btrfs-progs: fsck-test: Add check_sudo to check
valid root/sudo privilege
From: David Sterba
To: Qu Wenruo
Date: 2015年02月10日 21:30
On Mon, Feb 09, 2015 at 02:11:52PM +0800, Qu Wenruo wrote:
Although fsck-test/012 uses sudo, it uses 'su
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 to
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 to know that this is a metadump restore
On 02/10/2015 01:28 PM, Eric Sandeen wrote:
On 2/9/15 2:03 PM, 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 to know that this is a me
On 2/9/15 2:03 PM, 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 to know that this is a metadump restore so it
> doesn't do thin
2015-02-10 8:17 GMT+01:00 Kai Krakow :
> Tobias Holst 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 with 0 errors"
>
> D
> What I /suspect/ is happening, is that at the 10 GiB files size, on
> original file creation, btrfs is creating a large file of several
> comparatively large extents (possibly 1 GiB each, the nominal data chunk
> size, tho it can be larger on large enough filesystems). Note that btrfs
> will nor
On Thu, Jan 29, 2015 at 05:07:15PM +0800, Qu Wenruo wrote:
> Also, since only 2 patches is modified(although other part is slightly
> modified to match the change), to avoid mail bombing, I created the pull
> request on github and only send the first 2 patches with cover-letter.
> https://github.co
On Mon, Feb 09, 2015 at 03:03:03PM -0500, Josef Bacik wrote:
> This series of patches fixes up btrfsck in lots of ways and adds some new
> functionality. These patches were required to fix Hugo's broken multi-disk fs
> as well as fix fsck so it would actually pass all of the fsck tests. This
> a
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 conti
On Tuesday, February 10, 2015 2:17:43 AM EST, Kai Krakow wrote:
Tobias Holst 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 with 0
On Tue, Feb 10, 2015 at 10:24 AM, Dongsheng Yang
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. The data size in a deleted subvolume
> will never be decressed from all rel
So far, we have a type in each qgroup and we can create
a qgroup in different type. But there is no actual differenc
in accounting action in different qgroups.
This patch makes the qgroup ignore the qgroup recording
for other type. It means qgroup in DATA type only care
about the data size in this
When the type of a record is not considered, we currently ignore it at all.
But this operation may be considered by his parent.
This patch fix this problem, it record the operation and only accounting it
when current type cover the operation type in iteration.
Signed-off-by: Dongsheng Yang
---
From: Fan Chengniang
add --qgroup-type option to specify qgroup type. Type
can be metadata, data or mixed.
Signed-off-by: Fan Chengniang
Signed-off-by: Dongsheng Yang
---
Documentation/btrfs-qgroup.txt | 5 +
cmds-qgroup.c | 37 ++---
2 fi
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
---
fs/btrfs/qgroup.c | 18 ++
1 file changed, 14 insertions(+), 4 deletions(-)
diff --git a/fs/btrfs/qgroup.c
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.
Signed
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 qgro
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 cau
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 q
From: Fan Chengniang
make 'btrfs qgroup show' command show qgroup type.
Signed-off-by: Fan Chengniang
---
qgroup.c | 42 +++---
qgroup.h | 1 +
2 files changed, 40 insertions(+), 3 deletions(-)
diff --git a/qgroup.c b/qgroup.c
index a647925..d359659 100644
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
btrfs-
Signed-off-by: Dongsheng Yang
---
ctree.h | 12 +++-
ioctl.h | 1 +
mkfs.c | 2 ++
print-tree.c | 9 +
qgroup.c | 25 +++--
qgroup.h | 16
6 files changed, 58 insertions(+), 7 deletions(-)
diff --git a/ctree.h b/ctre
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
---
fs/btrfs/qgroup.c | 19 ++-
1 file changed, 14 insertions(+), 5 deletions(-)
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 th
From: Fan Chengniang
add --qgroup-type option to specify qgroup type. Type
can be metadata, data or all.
Signed-off-by: Fan Chengniang
Signed-off-by: Dongsheng Yang
---
Documentation/btrfs-subvolume.txt | 4
cmds-subvolume.c | 50 +--
When we exceed quota limit in writing, we will free
some reserved extent when we need to drop but not free
account in qgroup. It means, each time we exceed quota
in writing, there will be some remain space in qg->reserved
we can not use any more. If things go on like this, the
all space will be ate
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
---
fs/btrfs/exten
From: Fan Chengniang
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
---
fs/btrfs/ioctl.c | 6 ++
fs/btrfs/qgroup.c | 14 ++
fs/btrfs/qgrou
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
---
fs/btrfs/qgroup.c | 4
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 ex
Cleanup: Change the parameter of update_qgroup_limit_item() to the family of
update_qgroup_xxx_item().
Signed-off-by: Dongsheng Yang
---
fs/btrfs/qgroup.c | 51 ---
1 file changed, 24 insertions(+), 27 deletions(-)
diff --git a/fs/btrfs/qgroup.c b
From: Fan Chengniang
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
---
qgroup.c | 7 ---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/qgr
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
---
fs/btrfs/qgroup.c | 5 +
1 file changed, 5 insertions(+)
diff --git a/fs/btrfs/qgroup.c b/fs
When a qgroup has parents but no child, it should be removable in
Theory I think. But currently, we can not remove it when it has
either parent or child.
Example:
# btrfs quota enable /mnt
# btrfs qgroup create 1/0 /mnt
# btrfs qgroup create 2/0 /mnt
# btrfs qgroup
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 free
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
---
fs/btrfs/qgroup.c | 8
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/fs/btrfs/qgroup.c b/fs/btrfs/qgroup.c
index 34717ed..d3c261
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
Signed-off-by: Dongsheng Yang
---
fs/btrfs/qgroup.c | 15 ++-
From: Fan Chengniang
add -r and -e options to enable setting max reference size
and max exclusive on creating new subvolumes.
Signed-off-by: Fan Chengniang
---
Documentation/btrfs-subvolume.txt | 8 +++-
cmds-qgroup.c | 42 --
cmds-subvolume.c
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 r
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.
Signed-o
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 w
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
---
fs/btrfs/qgroup.c | 8
1 file changed, 8 insertions(+)
diff --git a/fs/btrfs/
Signed-off-by: Dongsheng Yang
---
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 b/fs/btrfs/ioctl.c
index d4
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 q
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 related,
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
> btrfs_delete_unused
53 matches
Mail list logo