On Wed, Jul 03, 2013 at 04:36:44PM -0400, Chris Mason wrote:
> Quoting Miao Xie (2013-07-03 09:25:08)
> > This patchset introduced chunk recover function, which was implemented by
> > scanning the whoel disks in the filesystem. Now, we can recover Single,
> > Dup, RAID1 chunks, and RAID0, RAID10, R
On Wed, 26 Jun 2013 20:53:00 +0300, Alex Lyakas wrote:
> Hi Miao,
>
> On Mon, Jun 17, 2013 at 4:51 AM, Miao Xie wrote:
>> On sun, 16 Jun 2013 13:38:42 +0300, Alex Lyakas wrote:
>>> Hi Miao,
>>>
>>> On Thu, Jun 13, 2013 at 6:08 AM, Miao Xie wrote:
On wed, 12 Jun 2013 23:11:02 +0300, Ale
On wed, 3 Jul 2013 15:17:02 +0100, Filipe David Manana wrote:
> On Wed, Jul 3, 2013 at 2:25 PM, Miao Xie wrote:
>>
>> +++ b/disk-io.c
>> @@ -1270,12 +1270,13 @@ static int close_all_devices(struct btrfs_fs_info
>> *fs_info)
>> while (!list_empty(list)) {
>> device = list_e
On Wed, Jul 03, 2013 at 06:25:59PM +0100, Filipe David Manana wrote:
> > Also, replacing the BUG_ON with something else would be nice of course.
>
> If you don't mind, I would prefer to do that as a different patch,
> since the BUG_ON() use is what is currently done everywhere in this
> function a
Quoting Miao Xie (2013-07-03 09:25:08)
> This patchset introduced chunk recover function, which was implemented by
> scanning the whoel disks in the filesystem. Now, we can recover Single,
> Dup, RAID1 chunks, and RAID0, RAID10, RAID5, RAID6 metadata chunks.
Really nice. I've integrated this with
Hi btrfs devs,
I have a btrfs raid10 array consisting of 2TB drives.
I added a new drive to the array, then balanced.
The balance failed after ~50GB was moved to the new drive.
The balance fixed lots of errors according to dmesg.
Server rebooted
The newly added drive were no longer detected as
Assert that the writes of the device and chunk tree
roots succeed. This verification is currently done
for all other tree roots, however it was missing for
those 2 trees.
Would these tree root writes fail, but all others succeed,
it would lead to a corrupted/incomplete btrfs filesystem,
or, more l
V2: removed unused statement in
extent-cache.c:tree_insert() too.
Signed-off-by: Filipe David Borba Manana
---
extent-cache.c |1 -
volumes.c |2 --
2 files changed, 3 deletions(-)
diff --git a/extent-cache.c b/extent-cache.c
index 3dd6434..a8bab59 100644
--- a/extent-cache.c
+
On Wed, Jul 3, 2013 at 6:09 PM, David Sterba wrote:
> On Sun, Jun 30, 2013 at 12:51:44PM +0100, Filipe David Borba Manana wrote:
>> Assert that the write of the device tree root succeeds.
>> This verification is currently done for all other tree
>> roots, however it was missing for the device tree
On Thu, Jul 04, 2013 at 12:07:37AM +0800, Wang Shilong wrote:
> From: Wang Shilong
>
> In the original code, pretty_sizes() may return NULL in two cases:
> <1> Allocating memory dynamically fails
Turning it into static allocation looks much better than calling
malloc for ~30 bytes.
> <2> Overfl
This commit adds support to print UUID tree elements to print-tree.c.
Signed-off-by: Stefan Behrens
---
fs/btrfs/print-tree.c | 24
1 file changed, 24 insertions(+)
diff --git a/fs/btrfs/print-tree.c b/fs/btrfs/print-tree.c
index dc0024f..b6b209c 100644
--- a/fs/btrfs/p
Mapping UUIDs to subvolume IDs is an operation with a high effort
today. Today, the algorithm even has quadratic effort (based on the
number of existing subvolumes), which means, that it takes minutes
to send/receive a single subvolume if 10,000 subvolumes exist. But
even linear effort would be too
Mapping UUIDs to subvolume IDs is an operation with a high effort
today. Today, the algorithm even has quadratic effort (based on the
number of existing subvolumes), which means, that it takes minutes
to send/receive a single subvolume if 10,000 subvolumes exist. But
even linear effort would be too
When a new subvolume or snapshot is created, a new UUID item is added
to the UUID tree. Such items are removed when the subvolume is deleted.
The ioctl to set the received subvolume UUID is also touched and will
now also add this received UUID into the UUID tree together with the
ID of the subvolum
When the UUID tree is initially created, a task is spawned that
walks through the root tree. For each found subvolume root_item,
the uuid and received_uuid entries in the UUID tree are added.
This is such a quick operation so that in case somebody wants
to unmount the filesystem while the task is s
This should never be needed, but since all functions are there
to check and rebuild the UUID tree, a mount option is added that
allows to force this check and rebuild procedure.
Signed-off-by: Stefan Behrens
---
fs/btrfs/ctree.h | 1 +
fs/btrfs/disk-io.c | 3 ++-
fs/btrfs/super.c | 8 +++
If the filesystem was mounted with an old kernel that was not
aware of the UUID tree, this is detected by looking at the
uuid_tree_generation field of the superblock (similar to how
the free space cache is doing it). If a mismatch is detected
at mount time, a thread is started that does two things:
In order to be able to detect the case that a filesystem is mounted
with an old kernel, add a uuid-tree-gen field like the free space
cache is doing it. It is part of the super block and written with
each commit. Old kernels do not know this field and don't update it.
Signed-off-by: Stefan Behrens
This tree is not created by mkfs.btrfs. Therefore when a filesystem
is mounted writable and the UUID tree does not exist, this tree is
created if required. The tree is also added to the fs_info structure
and initialized, but this commit does not yet read or write UUID tree
elements.
Signed-off-by:
On Sun, Jun 30, 2013 at 12:51:44PM +0100, Filipe David Borba Manana wrote:
> Assert that the write of the device tree root succeeds.
> This verification is currently done for all other tree
> roots, however it was missing for the device tree root.
>
> Would this tree root write fail, but all other
We want to test if path->slots[0] is greater than zero.
Testing for path->slots was a logical error, as it corresponds
to a memory address (start of fixed array) and therefore is
always non-zero.
Signed-off-by: Filipe David Borba Manana
---
extent-tree.c |2 +-
1 file changed, 1 insertion(+)
On Thu, 4 Jul 2013 00:24:45 +0800, Wang Shilong wrote:
> From: Wang Shilong
>
> extent-tree.c: In function 'btrfs_free_block_groups':
> extent-tree.c:3189:12: warning: cast to pointer from
> integer of different size [-Wint-to-pointer-cast]
>
> Signed-off-by: Wang Shilong
> ---
> extent-tree.
From: Wang Shilong
extent-tree.c: In function 'btrfs_free_block_groups':
extent-tree.c:3189:12: warning: cast to pointer from
integer of different size [-Wint-to-pointer-cast]
Signed-off-by: Wang Shilong
---
extent-tree.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/ex
From: Wang Shilong
In the original code, pretty_sizes() may return NULL in two cases:
<1> Allocating memory dynamically fails
<2> Overflow happens(size exceeds YB)
The original codes don't handle error gracefully and some places
forget to free memory.
However, just allocating memory before call
From: Wang Shilong
The operation related qgroup inherit may fails, if it fails, we should
free memory allocated,otherwise, memory leak happens.
Signed-off-by: Wang Shilong
---
cmds-subvolume.c | 30 --
1 file changed, 20 insertions(+), 10 deletions(-)
diff --git a/
On Wed, Jul 3, 2013 at 2:25 PM, Miao Xie wrote:
>
> +++ b/disk-io.c
> @@ -1270,12 +1270,13 @@ static int close_all_devices(struct btrfs_fs_info
> *fs_info)
> while (!list_empty(list)) {
> device = list_entry(list->next, struct btrfs_device,
> dev_list);
>
From: Wang Shilong
When making btrfs filesystem. we firstly write root leaf to
specified filed, and then we recow the root. If we don't recow,
some trees are not in the correct block group.
Steps to reproduce:
dd if=/dev/zero of=test.img bs=1M count=100
mkfs.btrfs -f test.img
In fact, the code of many rb-tree insert/search/delete functions is similar,
so we can abstract them, and implement common functions for rb-tree, and then
simplify them.
Signed-off-by: Miao Xie
---
btrfs-list.c | 19 +++-
cmds-check.c | 111 +++---
di
As we know, btrfs can manage several devices in the same fs, so [offset, size]
is not sufficient for unique identification of an device extent, we need the
device id to identify the device extents which have the same offset and size,
but are not in the same device. So, we added a member variant nam
This patch adds the function to check correspondence between block group,
chunk and device extent.
Original-signed-off-by: Cheng Yang
Signed-off-by: Miao Xie
---
Makefile | 2 +-
btrfsck.h| 118 +
cmds-check.c | 555 +
Add chunk rebuild for RAID1/SINGLE/DUP to chunk-recover command.
Before this patch chunk-recover can only scan and reuse the old chunk
data to recover. With this patch, chunk-recover can use the reference
between chunk/block group/dev extent to rebuild the whole chunk tree
even when old chunks are
Because the fs/file roots are not extents, so it is better to use rb-tree
to manage them. Fix it.
Signed-off-by: Miao Xie
---
ctree.h | 4 ++--
disk-io.c | 50 --
2 files changed, 38 insertions(+), 16 deletions(-)
diff --git a/ctree.h b/ctree.h
As we know, the file descriptor 0 is a special number, so we shouldn't
use it to initialize the file descriptor of the devices, or we might
close this special file descriptor by mistake when we close the devices.
"-1" is a better choice.
Signed-off-by: Miao Xie
---
btrfs-find-root.c | 5 -
d
According to the bytenr of the extent buffer record, we can calculate the index
of the stripes, and we also know which device and where we read out the extent
buffer record, that means we can know the relationship between the device extent
and the stripes in the chunk, by this relationship, we can
Signed-off-by: Miao Xie
---
btrfs-find-root.c | 137 +++-
disk-io.c | 473 +++---
disk-io.h | 12 ++
3 files changed, 307 insertions(+), 315 deletions(-)
diff --git a/btrfs-find-root.c b/btrfs-find-root.c
index da22c1d.
Signed-off-by: Miao Xie
---
list.h | 68 +-
1 file changed, 59 insertions(+), 9 deletions(-)
diff --git a/list.h b/list.h
index 50f4619..db7a58c 100644
--- a/list.h
+++ b/list.h
@@ -223,18 +223,18 @@ static inline int list_empty_car
Some commands(such as btrfs-convert) access the devices again after we close
the ctree, so it is better that we don't free the devices objects when the ctree
is closed, or we need re-allocate the memory for the devices. We needn't worry
the memory leak problem, because all the memory will be freed
This patchset introduced chunk recover function, which was implemented by
scanning the whoel disks in the filesystem. Now, we can recover Single,
Dup, RAID1 chunks, and RAID0, RAID10, RAID5, RAID6 metadata chunks.
Miao Xie (11):
Btrfs-progs: don't close the file descriptor 0 when closing a devic
Check if creating a sparse copy ("reflink") of a file on btrfs
expectedly fails when it's done between different filesystems or
different mount points of the same filesystem.
For both situations, these actions are executed:
- Copy a file with the reflink=auto option.
A normal copy should b
After reading all device items from the chunk tree, don't
exit the loop and then navigate down the tree again to find
the chunk items. Instead, if while reading the device items
we find a chunk item in the leaf keep iterating over the leaf
and process the chunk items - at the moment chunk items alw
This testscript creates reflinks to files on different subvolumes,
overwrites the original files and reflinks, and moves reflinked files
between subvolumes.
Signed-off-by: Koen De Wit
---
Two new common/rc functions used in this script (_require_cp_reflink and
_verify_reflink) have been submitted
On Sat, Jun 22, 2013 at 02:39:21PM +0900, Kusanagi Kouichi wrote:
> 'btrfs subvolume delete' crashes with segv if it runs in a detached mount.
One does not even need to do the lazy unmount. If the there are 2
processes attempting to delete the same snapshot and one deletes the
snapshot directory e
On Wed, Jul 03, 2013 at 12:02:52PM +0200, Koen De Wit wrote:
> On 07/03/2013 08:37 AM, Dave Chinner wrote:
>
> > On Tue, Jul 02, 2013 at 11:51:21AM -0400, Eric Sandeen wrote:
> >> On Jul 2, 2013, at 10:28 AM, Koen De Wit
> >> wrote:
> >>
> >>> Dave,
> >>>
> >>> Thanks for the review. I will clean
Em 02-07-2013 13:05, Stefan Behrens escreveu:
The reason why you are not able to send an incremental snapshot back
(as you tried it in your previous mail) is that the implementation
cannot handle it. The receive side gets a parent_uuid (in case of
incremental transfers using the "-p" option), thi
On 07/03/2013 08:37 AM, Dave Chinner wrote:
> On Tue, Jul 02, 2013 at 11:51:21AM -0400, Eric Sandeen wrote:
>> On Jul 2, 2013, at 10:28 AM, Koen De Wit
>> wrote:
>>
>>> Dave,
>>>
>>> Thanks for the review. I will clean up the commit message and do
>>> a full mail-to-myself-and-test-patch round tr
On Mon, Jul 01, 2013 at 04:22:06PM -0400, Josef Bacik wrote:
> On Mon, Jul 01, 2013 at 10:13:26PM +0800, Liu Bo wrote:
> > For partial extents, snapshot-aware defrag does not work as expected,
> > since
> > a) we use the wrong logical offset to search for parents, which should be
> >disk_bytenr
This is to test whether snapshot-aware defrag can work well on partial extents.
Signed-off-by: Liu Bo
---
tests/btrfs/308 | 93 +++
tests/btrfs/308.out |2 +
tests/btrfs/group |1 +
3 files changed, 96 insertions(+), 0 deletions(-)
On Wed, July 03, 2013 at 08:40 (+0200), Liu Bo wrote:
> commit 47fb091fb787420cd195e66f162737401cce023f(Btrfs: fix unlock after free
> on rewinded tree blocks)
> takes an extra increment on the reference of allocated dummy extent buffer,
> so now we
> cannot free this dummy one, and end up with e
48 matches
Mail list logo