Re: [PATCH] Btrfs: fix race condition between writting and scrubing supers

2013-10-23 Thread Stefan Behrens
On Tue, 22 Oct 2013 18:55:59 +0200, Bob Marley wrote: > On 22/10/2013 10:37, Stefan Behrens wrote: >> I don't believe that this issue can ever happen. I don't believe that >> somewhere on the path to the flash memory, to the magnetic disc or to >> the drive's ca

Re: [PATCH] Btrfs: check file extent type before anything else

2013-11-01 Thread Stefan Behrens
On Thu, 31 Oct 2013 16:50:43 -0400, Josef Bacik wrote: > I hit this problem with my no holes patch and it made me realize what the > problem was for bz 60834. If the first item in the leaf is an inline extent > and > we try to read anything starting from disk_bytenr onward we will read off the >

Re: [PATCH] Btrfs: avoid heavy operations in btrfs_commit_super

2013-11-04 Thread Stefan Behrens
On Sun, 3 Nov 2013 23:24:34 +0800, Liu Bo wrote: > The 'git blame' history shows that, the old transaction commit code has to do > twice to ensure roots are updated and we have to flush metadata and super > block > manually, however, right now all of these can be handled well inside > the transac

Re: [RFC PATCH] Btrfs: change ioctl number of BTRFS_IOC_START_SYNC to 21

2013-11-06 Thread Stefan Behrens
On Wed, 6 Nov 2013 17:01:19 +0800, Liu Bo wrote: > 24 has been assigned to both BTRFS_IOC_START_SYNC and > BTRFS_IOC_SUBVOL_CREATE_V2, > and BTRFS_IOC_SUBVOL_CREATE_V2 is at least used in btrfs-progs > while BTRFS_IOC_START_SYNC is not. > > 21 is free according to link[1], and seems safe to be a

Re: Fwd: unable to delete files after kernel upgrade from 3.8.10 to 3.12

2013-11-07 Thread Stefan Behrens
On Wed, 6 Nov 2013 21:53:25 +, Bartosz Kulicki wrote: > As per subject. Seems UUID tree creation failed after upgrade. I could > not mount filesystem under 3.12. Going back to 3.8.10 allowed me to > mount fs but I could no longer perform any deletes, writes etc. > > I've opened a bug report he

Re: [PATCH v3 02/17] btrfs: Added btrfs_workqueue_struct implemented ordered execution based on kernel workqueue

2013-11-07 Thread Stefan Behrens
On Thu, 7 Nov 2013 13:51:52 +0800, Qu Wenruo wrote: > Use kernel workqueue to implement a new btrfs_workqueue_struct, which > has the ordering execution feature like the btrfs_worker. > > The func is executed in a concurrency way, and the > ordred_func/ordered_free is executed in the sequence them

Re: [PATCH 1/3] btrfs-progs: mechanism to fetch fsinfo from btrfs-control v3

2013-11-07 Thread Stefan Behrens
On Thu, 7 Nov 2013 18:01:41 +0800, Anand Jain wrote: > + *out_fslist = malloc(sz); > + if (*out_fslist == NULL) { > + ret = -ENOMEM; > + goto out; > + } > + memcpy(*out_fslist, fslist, sz); > + ret = 0; > +out: > + free(fsargs_saved); > + close(f

Re: Btrfs-progs static compile failure due to multiple uuid-tree.o in linking paratemeters

2013-11-11 Thread Stefan Behrens
On Sat, 9 Nov 2013 11:22:01 +0200, Emil Karlson wrote: > Greetings > > Btrfs-progs static compile fails due to multiple uuid-tree.o in > linking paratemeters: > > build error: > gcc -g -O1 -ffunction-sections -fdata-sections -o btrfs.static > btrfs.static.o help.static.o cmds-subvolume.static.o

Re: [PATCH] Btrfs-progs: try harder to make btrfs receive successfully

2013-11-13 Thread Stefan Behrens
an incremental backup file, in this case, this patch makes sense. Otherwise, the send and receive procedure could simply be replaced by 'btrfs sub snapshot -r /snap2 /backup/snap2'. Reviewed-by: Stefan Behrens > > Above steps will make btrfs receive fails with "ERROR: can

[PATCH] Btrfs: print bytenr instead of page pointer in check-int

2013-11-13 Thread Stefan Behrens
many million useless lines in the kernel log. And a comment is added that explains that LOG_BUF_SHIFT needs to be set to a really high value. Signed-off-by: Stefan Behrens --- fs/btrfs/check-integrity.c | 25 + 1 file changed, 17 insertions(+), 8 deletions(-) diff --git

Re: [PATCH 1/2] Documentation: filesystems: add new btrfs mount options

2013-11-21 Thread Stefan Behrens
On Wed, 20 Nov 2013 15:05:51 +0100, David Sterba wrote: > Two new options were added in 3.12: commit and rescan_uuid_tree > > CC: linux-...@vger.kernel.org > Signed-off-by: David Sterba > --- > Documentation/filesystems/btrfs.txt | 12 +++- > 1 file changed, 11 insertions(+), 1 deletion(

Re: Receive fails (Could not find parent subvolume)

2013-11-22 Thread Stefan Behrens
On Fri, 22 Nov 2013 01:47:43 -0800, Joshua Varghese wrote: > Hi, > > I'm trying to implement a mechanism for incremental backup using btrfs. > I have two hardisks and each has a btrfs partition on it. I am able to > take a snapshot of the source partition and send it to the backup disk > using the

Re: [PATCH] Btrfs-progs: avoid using btrfs internal subvolume path to send

2013-11-29 Thread Stefan Behrens
On Fri, 29 Nov 2013 22:23:09 +0800, Wang Shilong wrote: > From: Wang Shilong > > Steps to reproduce: > # mkfs.btrfs -f /dev/sda > # mount /dev/sda /mnt > # btrfs subvolume create /mnt/foo > # umount /mnt > # mount -o subvol=foo /dev/sda /mnt > # btrfs sub snaps

Re: [PATCH v2 3/3] btrfs-progs: handle error in the btrfs_prepare_device

2013-12-17 Thread Stefan Behrens
On Tue, 17 Dec 2013 10:33:36 +0800, Anand Jain wrote: > this patch will handle the strerror reporting of the error instead of > printing errno, and also replaced the BUG_ON with the error handling > > Signed-off-by: Anand Jain > --- > v2: commit update > --- > cmds-device.c | 7 +++ > cm

[PATCH] Btrfs-progs: use atoll() for mkfs.btrfs size option

2012-10-15 Thread Stefan Behrens
mkfs.btrfs parameter list would also be a working workaround. Signed-off-by: Stefan Behrens --- The patch is based on the master branch of git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-progs.git mkfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mkfs.c b/mk

Re: [PATCH] Move parse_size() in utils.c

2012-10-15 Thread Stefan Behrens
Hi Goffredo On 10/15/2012 21:15, Goffredo Baroncelli wrote: From: Goffredo Baroncelli Move parse_size() in utils.c, because it is used both from cmds-filesystem.c and mkfs.c. Makes sense. (Jan also sent such a patch on 1 Feb 2011

[PATCH] Btrfs-progs: add btrfs-show-super tool

2012-10-19 Thread Stefan Behrens
Just a small program to print the fields of a super block. Signed-off-by: Stefan Behrens --- Makefile | 5 +- btrfs-show-super.c | 201 + 2 files changed, 205 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index

Re: [PATCH] Btrfs-progs: add btrfs-show-super tool

2012-10-29 Thread Stefan Behrens
On 10/29/2012 18:55, Goffredo Baroncelli wrote: On 2012-10-29 12:00, Stefan Behrens wrote: All your comments are correct and are good suggestions for improvements. Thank you! [...] I think that it would be a great debug tool. Can I update your patch with my improvements ? Great, thanks

[PATCH] Btrfs: don't allow degraded mount if too many devices are missing

2012-10-30 Thread Stefan Behrens
number of devices that are tolerated to be missing according to the configured RAID level. If more devices are missing than tolerated, e.g. if two devices are missing in case of RAID1, only a read-only mount and remount is allowed. Signed-off-by: Stefan Behrens --- fs/btrfs/disk-io.c | 7 +++ fs

Re: [PATCH v5 1/3] Btrfs-progs: move open_file_or_dir() to utils.c

2012-10-31 Thread Stefan Behrens
it, Hugo was absolutely right to get upset when I was moving and changing a function in one go <http://www.spinics.net/lists/linux-btrfs/msg17067.html>). Stefan > > On 25/05/12 22:07, Stefan Behrens wrote: >> This is a preparation step to add support for device st

Re: [PATCH] Add btrfs-show-super

2012-11-02 Thread Stefan Behrens
On 11/02/2012 15:17, Goffredo Baroncelli wrote: Signed-off-by: Goffredo Baroncelli --- Makefile |5 +- btrfs-show-super.c | 284 2 files changed, 288 insertions(+), 1 deletion(-) create mode 100644 btrfs-show-super.c Go

Re: [PATCH] Add btrfs-show-super

2012-11-02 Thread Stefan Behrens
On 11/02/2012 22:46, Goffredo Baroncelli wrote: Signed-off-by: Goffredo Baroncelli --- Makefile |5 +- btrfs-show-super.c | 284 2 files changed, 288 insertions(+), 1 deletion(-) create mode 100644 btrfs-show-super.c diff

[PATCH] Btrfs: Don't trust the superblock label and simply printk("%s") it

2012-11-05 Thread Stefan Behrens
Someone who is root or capable(CAP_SYS_ADMIN) could corrupt the superblock and make Btrfs printk("%s") crash while holding the uuid_mutex since nobody forces a limit on the string. Since the uuid_mutex is significant, the system would be unusable afterwards. Signed-off-by: Stefan Behren

[PATCH 12/26] Btrfs: avoid risk of a deadlock in btrfs_handle_error

2012-11-06 Thread Stefan Behrens
other tasks that are running in user mode context, they are not affected or stopped in btrfs_handle_error(), these tasks just need to handle write errors correctly. Signed-off-by: Stefan Behrens --- fs/btrfs/super.c | 11 ++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/fs

[PATCH 21/26] Btrfs: introduce GET_READ_MIRRORS functionality for btrfs_map_block()

2012-11-06 Thread Stefan Behrens
the target disk, but not all reads would return valid data on the target disk. Therefore it is not possible anymore to abuse a REQ_WRITE interface to find valid mirrors for a REQ_READ. Signed-off-by: Stefan Behrens --- fs/btrfs/ctree.h | 3 +++ fs/btrfs/reada.c | 3 ++- fs/btrfs/scrub.c | 4

[PATCH 17/26] Btrfs: disallow some operations on the device replace target device

2012-11-06 Thread Stefan Behrens
This patch adds some code to disallow operations on the device that is used as the target for the device replace operation. Signed-off-by: Stefan Behrens --- fs/btrfs/ctree.h | 2 +- fs/btrfs/extent-tree.c | 3 ++- fs/btrfs/ioctl.c | 8 +++- fs/btrfs/scrub.c | 14

[PATCH 11/26] Btrfs: pass fs_info instead of root

2012-11-06 Thread Stefan Behrens
is replaced with the fs_info pointer argument. Signed-off-by: Stefan Behrens --- fs/btrfs/ctree.h | 11 fs/btrfs/disk-io.c | 4 +-- fs/btrfs/ioctl.c | 8 +++--- fs/btrfs/scrub.c | 76 -- fs/btrfs/super.c | 2 +- fs/btrfs

[PATCH 10/26] Btrfs: add btrfs_scratch_superblock() function

2012-11-06 Thread Stefan Behrens
This new function is used by the device replace procedure in a later patch. Signed-off-by: Stefan Behrens --- fs/btrfs/volumes.c | 18 ++ fs/btrfs/volumes.h | 1 + 2 files changed, 19 insertions(+) diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index c79f8db..bf5e68b

[PATCH 06/26] Btrfs: cleanup scrub bio and worker wait code

2012-11-06 Thread Stefan Behrens
Just move some code into functions to make everything more readable. Signed-off-by: Stefan Behrens --- fs/btrfs/scrub.c | 106 +-- 1 file changed, 71 insertions(+), 35 deletions(-) diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c index

[PATCH 14/26] Btrfs: introduce a btrfs_dev_replace_item type

2012-11-06 Thread Stefan Behrens
Signed-off-by: Stefan Behrens --- fs/btrfs/ctree.h | 66 +++ fs/btrfs/print-tree.c | 3 +++ 2 files changed, 69 insertions(+) diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index 57961f1..4bffc63 100644 --- a/fs/btrfs/ctree.h +++ b/fs

[PATCH 24/26] Btrfs: increase BTRFS_MAX_MIRRORS by one for dev replace

2012-11-06 Thread Stefan Behrens
used to read data in order to repair read errors on other disks. Signed-off-by: Stefan Behrens --- fs/btrfs/ctree.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index 01fcfcb..133e5c4 100644 --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h

[PATCH 09/26] Btrfs: pass fs_info to btrfs_map_block() instead of mapping_tree

2012-11-06 Thread Stefan Behrens
This is required for the device replace procedure in a later step. Two calling functions also had to be changed to have the fs_info pointer: repair_io_failure() and scrub_setup_recheck_block(). Signed-off-by: Stefan Behrens --- fs/btrfs/check-integrity.c | 2 +- fs/btrfs/extent-tree.c | 2

[PATCH 00/26] Btrfs: Add device replace code

2012-11-06 Thread Stefan Behrens
place operation. Stefan Behrens (26): Btrfs: rename the scrub context structure Btrfs: remove the block device pointer from the scrub context struct Btrfs: make the scrub page array dynamically allocated Btrfs: in scrub repair code, optimize the reading of mirrors Btrfs: in scrub repair

[PATCH 04/26] Btrfs: in scrub repair code, optimize the reading of mirrors

2012-11-06 Thread Stefan Behrens
when a perfect mirror is found. Signed-off-by: Stefan Behrens --- fs/btrfs/scrub.c | 35 --- 1 file changed, 12 insertions(+), 23 deletions(-) diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c index 15ac82a..7d38f40 100644 --- a/fs/btrfs/scrub.c +++ b/fs/btrfs

[PATCH 01/26] Btrfs: rename the scrub context structure

2012-11-06 Thread Stefan Behrens
of the term "dev" to the term "ctx" whereever the scrub context is used. Signed-off-by: Stefan Behrens --- fs/btrfs/scrub.c | 504 ++--- fs/btrfs/volumes.h | 2 +- 2 files changed, 253 insertions(+), 253 deletions(-) d

[PATCH 07/26] Btrfs: add two more find_device() methods

2012-11-06 Thread Stefan Behrens
functions that look similar at first view are all a little bit different in what they are doing. But in the future, new code could benefit from these two new functions, and currently, device replace uses them. Signed-off-by: Stefan Behrens --- fs/btrfs/volumes.c | 74

[PATCH 18/26] Btrfs: handle errors from btrfs_map_bio() everywhere

2012-11-06 Thread Stefan Behrens
isk, since it is used last. And when this mirror is not available because the copy procedure has not yet handled this area, an error is returned. Everywhere in the code the handling of such errors is added now. Signed-off-by: Stefan Behrens --- fs/btrfs/check-integrity.c | 15 +-- fs/bt

[PATCH 13/26] Btrfs: enhance btrfs structures for device replace support

2012-11-06 Thread Stefan Behrens
Signed-off-by: Stefan Behrens --- fs/btrfs/ctree.h | 39 +++ fs/btrfs/disk-io.c | 5 + 2 files changed, 44 insertions(+) diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index ef83538..57961f1 100644 --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h

[PATCH 20/26] Btrfs: change core code of btrfs to support the device replace operations

2012-11-06 Thread Stefan Behrens
This commit contains all the essential changes to the core code of Btrfs for support of the device replace procedure. Signed-off-by: Stefan Behrens --- fs/btrfs/Makefile | 2 +- fs/btrfs/ctree.h | 2 + fs/btrfs/disk-io.c | 24 +- fs/btrfs/reada.c | 17 + fs

[PATCH 26/26] Btrfs: add support for device replace ioctls

2012-11-06 Thread Stefan Behrens
This is the commit that allows to start the device replace procedure. An ioctl() interface is added that supports starting and canceling the device replace procedure, and to retrieve the status and progress. Signed-off-by: Stefan Behrens --- fs/btrfs/ioctl.c | 48

[PATCH 08/26] Btrfs: Pass fs_info to btrfs_num_copies() instead of mapping_tree

2012-11-06 Thread Stefan Behrens
This is required for the device replace procedure in a later step. Signed-off-by: Stefan Behrens --- fs/btrfs/check-integrity.c | 12 ++-- fs/btrfs/disk-io.c | 2 +- fs/btrfs/extent_io.c | 11 +-- fs/btrfs/volumes.c | 3 ++- fs/btrfs/volumes.h

[PATCH 16/26] Btrfs: disallow mutually exclusiv admin operations from user mode

2012-11-06 Thread Stefan Behrens
Btrfs admin operations that are manually started from user mode and that cannot be executed at the same time return -EINPROGRESS. A common way to enter and leave this locked section is introduced since it used to be specific to the balance operation. Signed-off-by: Stefan Behrens --- fs/btrfs

[PATCH 02/26] Btrfs: remove the block device pointer from the scrub context struct

2012-11-06 Thread Stefan Behrens
is known. Signed-off-by: Stefan Behrens --- fs/btrfs/scrub.c | 133 ++- 1 file changed, 73 insertions(+), 60 deletions(-) diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c index 29c8aac..822c08a 100644 --- a/fs/btrfs/scrub.c +++ b/fs/btrfs

[PATCH 03/26] Btrfs: make the scrub page array dynamically allocated

2012-11-06 Thread Stefan Behrens
: Stefan Behrens --- fs/btrfs/scrub.c | 195 ++- 1 file changed, 121 insertions(+), 74 deletions(-) diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c index 822c08a..15ac82a 100644 --- a/fs/btrfs/scrub.c +++ b/fs/btrfs/scrub.c @@ -46,6 +46,12

[PATCH 15/26] Btrfs: add a new source file with device replace code

2012-11-06 Thread Stefan Behrens
This adds a new file to the sources together with the header file and the changes to ioctl.h that are required by the new C source file. Signed-off-by: Stefan Behrens --- fs/btrfs/dev-replace.c | 843 + fs/btrfs/dev-replace.h | 44 +++ fs/btrfs

[PATCH 25/26] Btrfs: allow repair code to include target disk when searching mirrors

2012-11-06 Thread Stefan Behrens
partially filled with the filesystem data. Signed-off-by: Stefan Behrens --- fs/btrfs/volumes.c | 159 +++-- 1 file changed, 154 insertions(+), 5 deletions(-) diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index edd5573..959a4c8 100644 --- a/fs

[PATCH 22/26] Btrfs: changes to live filesystem are also written to replacement disk

2012-11-06 Thread Stefan Behrens
. Signed-off-by: Stefan Behrens --- fs/btrfs/volumes.c | 50 +- 1 file changed, 49 insertions(+), 1 deletion(-) diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 208cc13..164f9b1 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c

[PATCH 19/26] Btrfs: add code to scrub to copy read data to another disk

2012-11-06 Thread Stefan Behrens
operation works as fast as before, it is not negatively influenced and actually it is more or less unchanged. Signed-off-by: Stefan Behrens --- fs/btrfs/ctree.h | 2 + fs/btrfs/reada.c | 10 +- fs/btrfs/scrub.c | 881 ++- fs/btrfs/super.c

[PATCH 05/26] Btrfs: in scrub repair code, simplify alloc error handling

2012-11-06 Thread Stefan Behrens
In the scrub repair code, the code is changed to handle memory allocation errors a little bit smarter. The change is to handle it just like a read error. This simplifies the code and removes a couple of lines of code, since the code to handle read errors is there anyway. Signed-off-by: Stefan

[PATCH 23/26] Btrfs: optionally avoid reads from device replace source drive

2012-11-06 Thread Stefan Behrens
changed by this commit. Signed-off-by: Stefan Behrens --- fs/btrfs/volumes.c | 46 +++--- 1 file changed, 35 insertions(+), 11 deletions(-) diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 164f9b1..edd5573 100644 --- a/fs/btrfs/volumes.c +++ b/fs

[PATCH] Btrfs-progs: add support for device replace procedure

2012-11-06 Thread Stefan Behrens
This is the user mode part of the device replace patch series. The command group "btrfs replace" is added with three commands: - btrfs replace start mount_point srcdev|srcdevid targetdev [-Bfr] - btrfs replace status mount_point [-1] - btrfs replace cancel mount_point Signed-off-

Re: [PATCH 00/26] Btrfs: Add device replace code

2012-11-06 Thread Stefan Behrens
On 11/06/2012 19:17, Bart Noordervliet wrote: Great new feature Stefan, thanks a lot! Going to give it a spin right away. While compiling I got this (probably superfluous) error that you might want to prevent: fs/btrfs/dev-replace.c: In function ‘btrfs_dev_replace_start’: fs/btrfs/dev-replace.c:

Re: [PATCH 00/26] Btrfs: Add device replace code

2012-11-07 Thread Stefan Behrens
On Tue, 6 Nov 2012 14:48:36 -0800, Zach Brown wrote: >>> Yes, this happens on 32 bit builds, not on 64 bit builds. If you >>> look at the source code, the compiler is obviously wrong (or I am >>> blind). >>> >>> ret = btrfs_dev_replace_find_srcdev(root, args->start.srcdevid, >>>

Re: [PATCH 19/26] Btrfs: add code to scrub to copy read data to another disk

2012-11-07 Thread Stefan Behrens
On Wed, 07 Nov 2012 09:30:59 +0900, Tsutomu Itoh wrote: > (2012/11/07 1:38), Stefan Behrens wrote: >> +static int scrub_add_page_to_wr_bio(struct scrub_ctx *sctx, >> +struct scrub_page *spage) >> +{ >> +struct scrub_wr_ctx *wr_ctx = &a

Re: [PATCH 00/26] Btrfs: Add device replace code

2012-11-07 Thread Stefan Behrens
On Wed, 07 Nov 2012 11:14:36 +0900, Tsutomu Itoh wrote: > (2012/11/07 1:38), Stefan Behrens wrote: >> replace start [-Bfr] | > > I think that > "btrfs replace start [-Bfr] | " > of the same synopsis as other subcommands is better. You are right. 'btrfs

Re: fs/btrfs/dev-replace.c:486:17: sparse: incompatible types in comparison expression (different address spaces)

2012-11-08 Thread Stefan Behrens
gt; named 'mutually_exclusive_operation_running' > fs/btrfs/dev-replace.c: In function 'btrfs_dev_replace_continue_on_mount': > fs/btrfs/dev-replace.c:769:10: error: too many arguments to function > 'btrfs_scrub_dev' > In file included from fs/btrfs/dev-

Re: [PATCH 15/26] Btrfs: add a new source file with device replace code

2012-11-08 Thread Stefan Behrens
On Thu, 8 Nov 2012 22:50:47 +0800, Liu Bo wrote: > On Tue, Nov 06, 2012 at 05:38:33PM +0100, Stefan Behrens wrote: >> +out: >> +if (path) { >> +btrfs_release_path(path); >> +btrfs_free_path(path); > > btrfs_free_path(path) wil

Re: [PATCH 00/26] Btrfs: Add device replace code

2012-11-08 Thread Stefan Behrens
On Thu, 8 Nov 2012 13:50:19 +0100, Goffredo Baroncelli wrote: > great work. However I have a suggestion: what about putting all the > command under 'device' sub commands: something like: > > - btrfs device replace > > - btrfs device status > > Where "btrfs device status" would show only the

Re: [PATCH 15/26] Btrfs: add a new source file with device replace code

2012-11-09 Thread Stefan Behrens
On Fri, 9 Nov 2012 08:44:01 +0800, Liu Bo wrote: > On Thu, Nov 08, 2012 at 06:24:36PM +0100, Stefan Behrens wrote: >> On Thu, 8 Nov 2012 22:50:47 +0800, Liu Bo wrote: >>> On Tue, Nov 06, 2012 at 05:38:33PM +0100, Stefan Behrens wrote: >>>> + trans = btrfs_start_trans

Re: [PATCH 24/26] Btrfs: increase BTRFS_MAX_MIRRORS by one for dev replace

2012-11-09 Thread Stefan Behrens
On Fri, 9 Nov 2012 10:47:39 +, David Pottage wrote: > Are you assuming the user is only replacing one device at once? > > If the user is upgrading their disc array to increase the capacity (or > speed), then it would make sense for them to replace all the drives in the > array at once. Is th

Re: fs/btrfs/dev-replace.c:486:17: sparse: incompatible types in comparison expression (different address spaces)

2012-11-09 Thread Stefan Behrens
On Thu, 8 Nov 2012 15:35:41 +0800, Fengguang Wu wrote: > Hi Stefan, > > FYI, there are new sparse warnings show up in > > tree: git://git.kernel.org/pub/scm/linux/kernel/git/josef/btrfs-next.git > master > head: c1014be59ba93855c31fda9d9cf4319cc6f9eeb1 > commit: d8e784f51e2e1d1c57f091fdb4945

Re: [PATCH 07/26] Btrfs: add two more find_device() methods

2012-11-12 Thread Stefan Behrens
On Thu, 8 Nov 2012 22:24:51 +0800, Liu Bo wrote: > On Tue, Nov 06, 2012 at 05:38:25PM +0100, Stefan Behrens wrote: >> The new function btrfs_find_device_missing_or_by_path() will be >> used for the device replace procedure. This function itself calls >> th

Re: [PATCH 15/26] Btrfs: add a new source file with device replace code

2012-11-12 Thread Stefan Behrens
On Fri, 9 Nov 2012 22:45:16 +0800, Liu Bo wrote: > On Fri, Nov 09, 2012 at 11:19:17AM +0100, Stefan Behrens wrote: >> On Fri, 9 Nov 2012 08:44:01 +0800, Liu Bo wrote: >>> On Thu, Nov 08, 2012 at 06:24:36PM +0100, Stefan Behrens wrote: >>>> On Thu, 8 Nov 2012 22:50:47

Re: [PATCH 00/26] Btrfs: Add device replace code

2012-11-14 Thread Stefan Behrens
On Tue, 13 Nov 2012 17:25:46 +0100, Bart Noordervliet wrote: > Hi Stefan, > > I gave your patchset a whirl and it worked like a charm. Thanks a lot > for your work. I was confused for a moment by the fact that the > operation doesn't immediately resize btrfs to use all of the new > device's availa

Re: kernel BUG at btrfs/scrub.c:638 (kernel 3.6.5)

2012-11-14 Thread Stefan Behrens
On Wed, 14 Nov 2012 15:27:28 +0100, Joeri Vanthienen wrote: > Hi, > > I was testing a new HBA (lsi SAS2008 based) in combination with BTRFS > and kernel 3.6.5 > > #mkfs.btrfs -m raid1 -d raid1 /dev/sdf /dev/sdg > # btrfs filesystem show > Label: none uuid: fe542409-7346-4ea1-af04-fd1765b6a1a2 >

[PATCH] Btrfs: fix BUG() in scrub when first superblock reading gives EIO

2012-11-14 Thread Stefan Behrens
BUG() in a subfunction. The BUG() is correct, it would crash later otherwise. The subfunction must not be called for superblocks and this is what the fix changes. Reported-by: Joeri Vanthienen Signed-off-by: Stefan Behrens --- This patch is for btrfs-next, not for 3.7rc. fs/btrfs/scrub.c | 11

[PATCH] Btrfs: fix race in check-integrity caused by usage of bitfield

2012-11-27 Thread Stefan Behrens
This patch seperates the bits and fixes the race. Signed-off-by: Stefan Behrens --- fs/btrfs/check-integrity.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/btrfs/check-integrity.c b/fs/btrfs/check-integrity.c index 5a3e45d..a6baa8e 100644 --- a/fs/btrfs/check-integrity.c

[PATCH] Btrfs: fix a scrub regression in case of write errors

2012-11-27 Thread Stefan Behrens
This regression was introduced by the device-replace patches. Scrub immediately stops checking those disks that have write errors. This is nothing that happens in the real world, but it is wrong since scrub is the tool to detect and repair defects. Fix it. Signed-off-by: Stefan Behrens --- This

[PATCH] Btrfs: fix a build warning for an unused label

2012-11-27 Thread Stefan Behrens
This issue was detected by the "0-DAY kernel build testing". fs/btrfs/volumes.c: In function 'btrfs_rm_device': fs/btrfs/volumes.c:1505:1: warning: label 'error_close' defined but not used [-Wunused-label] Signed-off-by: Stefan Behrens --- This patch is o

[PATCH v2] Btrfs-progs: add support for device replace procedure

2012-12-11 Thread Stefan Behrens
This is the user mode part of the device replace patch series. The command group "btrfs replace" is added with three commands: - btrfs replace start srcdev|srcdevid targetdev [-Bfr] mount_point - btrfs replace status mount_point [-1] - btrfs replace cancel mount_point Signed-off-

[BUG] issue with btrfs-next and xfstest 241

2012-12-12 Thread Stefan Behrens
The problem is that a new superblock is written which references a block in the log tree although this block is written _after_ the superblock is written and never before. The referenced block in the following log is the one with the logical byte number 35770368 which physically is located on (

[BUG] btrfs-next issues detected with xfstest, part #1

2012-12-12 Thread Stefan Behrens
Make sure you have a wide terminal to read the following logs. The current btrfs-next was taken to run the xfstest suite. export TEST_DEV=/dev/sdg export TEST_DIR=/mnt3 export SCRATCH_DEV=/dev/sdi export SCRATCH_MNT=/mnt2 cd ~/git/xfs/cmds/xfstests grep check_int common.rc gives this result:

[BUG] btrfs-next issues detected with xfstest, part #2

2012-12-12 Thread Stefan Behrens
This is the last part. ./check 078-299 [112] Dec 12 12:51:05 qvarne root: run xfstest 112 device fsid 55bc7fff-2ed3-48c4-94d8-e4ec5157ae21 devid 1 transid 35 /dev/sdg btrfs: enabling check integrity btrfs: use lzo compression btrfs: enabling auto defrag btrfs: disk space caching is enabled --

Re: [RFC PATCH v7 1/2] Btrfs: Add a new ioctl to get the label of a mounted file system

2012-12-21 Thread Stefan Behrens
On 12/21/2012 07:42, Jeff Liu wrote: On 12/21/2012 04:18 AM, Goffredo Baroncelli wrote: On 12/20/2012 09:43 AM, Jeff Liu wrote: +static int btrfs_ioctl_get_fslabel(struct file *file, void __user *arg) +{ + struct btrfs_root *root = BTRFS_I(fdentry(file)->d_inode)->root; + const char

Re: [PATCH 1/3] Btrfs: fix missing write access release in btrfs_ioctl_resize()

2012-12-21 Thread Stefan Behrens
On Fri, 21 Dec 2012 17:19:20 +0800, Miao Xie wrote: > - pr_info("btrfs: dev add/delete/balance/replace/resize operation > in progress\n"); > + pr_info("btrfs: dev add/delete/balance/replace/resize operation" > + " in progress\n"); > + mnt_dro

Re: [PATCH 05/13] Add btrfs-show-super

2013-01-21 Thread Stefan Behrens
g it, JFYI. I am not sure if he want to Sign it. During the review he blamed about some style issues. But for time constraints I was not able to update the patches. So before adding Stefen's S-o-B we need an ack from him. For the record, all the extra spaces are not from me. Signed-of

Re: [PATCH 01/10] Btrfs-progs: move open_file_or_dir() to utils.c

2013-01-24 Thread Stefan Behrens
On Wed, 23 Jan 2013 22:39:29 -0600, Eric Sandeen wrote: > instead of renaming & keeping the btrfsctl.c copy There is a new momentum to improve the Btrfs-progs quality :) IMO, one step is to get rid of the legacy tools and sources. It wastes time to maintain them and these old tools cause confusio

Re: [PATCH 10/10] Btrfs-progs: add show subcommand to subvol cli

2013-01-25 Thread Stefan Behrens
On Fri, 25 Jan 2013 17:30:39 +0800, Anand Jain wrote: > This adds show sub-command to the btrfs subvol cli > to display detailed inforamtion of the given subvol > or snapshot. > > Signed-off-by: Anand Jain > --- > btrfs-list.c | 25 +++- > btrfs-list.h | 3 +- > cmds-subvolume.c |

Re: [PATCH] Btrfs-progs: Exit if not running as root

2013-01-25 Thread Stefan Behrens
On Fri, 25 Jan 2013 06:32:30 -0500, Gene Czarcinski wrote: > This patch hits a lot of files but adds little code. It > could be considered a bugfix, Currently, when one of the > btrfs user-space programs is executed by a regular user, > the result if oftem a number of strange error messages > whi

Re: [PATCH] Btrfs-progs: Exit if not running as root

2013-01-25 Thread Stefan Behrens
On Fri, 25 Jan 2013 07:03:19 -0500, Gene Czarcinski wrote: > On 01/25/2013 06:41 AM, Stefan Behrens wrote: >> On Fri, 25 Jan 2013 06:32:30 -0500, Gene Czarcinski wrote: >>> This patch hits a lot of files but adds little code. It >>> could be considered a bugfix,

Re: [PATCH V5] Btrfs: snapshot-aware defrag

2013-01-25 Thread Stefan Behrens
On Fri, 25 Jan 2013 08:55:58 -0600, Mitch Harder wrote: > On Wed, Jan 23, 2013 at 6:52 PM, Liu Bo wrote: >> On Wed, Jan 23, 2013 at 10:05:04AM -0600, Mitch Harder wrote: >>> On Wed, Jan 23, 2013 at 1:51 AM, Liu Bo wrote: On Tue, Jan 22, 2013 at 11:41:19AM -0600, Mitch Harder wrote: > On

Re: [PATCH] Btrfs-progs: remove btrfsctl, btrfs-show and btrfs-vol from default build

2013-01-25 Thread Stefan Behrens
On Fri, 25 Jan 2013 09:32:01 -0600, Eric Sandeen wrote: > On 1/25/13 5:57 AM, Gene Czarcinski wrote: >> On 06/08/2012 02:00 PM, Stefan Behrens wrote: >>> Remove btrfsctl, btrfs-show and btrfs-vol from "all" target of Makefile. > > TBH, unless there are object

Re: [PATCH V5] Btrfs: snapshot-aware defrag

2013-01-28 Thread Stefan Behrens
100, Stefan Behrens wrote: >> Well, the issue that I had reported on IRC some days ago which looks similar >> (the top part of the call trace is similar: iput -> evict -> destroy_inode >> -> btrfs_destroy_inode -> btrfs_add_dead_root -> list_add which warns in >

Re: [PATCH 2/2] btrfs-progs: remove btrfslabel.[c|h]

2013-01-29 Thread Stefan Behrens
On Tue, 29 Jan 2013 14:24:13 +0800, Jeff Liu wrote: > Clean btrfslabel.[c|h] out of the source tree and move those related > functions to utils.[c|h]. > > Signed-off-by: Jie Liu > CC: David Sterba > CC: Gene Czarcinski > --- > Makefile |4 +- > btrfslabel.c | 178 >

Re: [PATCH] Btrfs: cleanup orphan reservation if truncate fails

2013-02-08 Thread Stefan Behrens
On Thu, 7 Feb 2013 16:28:44 -0500, Josef Bacik wrote: > I noticed we were getting lots of warnings with xfstest 83 because we have > reservations outstanding. This is because we moved the orphan add outside > of the truncate, but we don't actually cleanup our reservation if something > fails. Thi

Re: Rebalancing RAID1

2013-02-18 Thread Stefan Behrens
On Fri, 15 Feb 2013 22:56:19 +0100 (CET), Fredrik Tolf wrote: > The oops cut can be found here: > This scrub issue is fixed since Linux 3.8-rc1 with commit 4ded4f6 Btrfs: fix BUG() in scrub when first superblock reading gives EIO -- To unsubscrib

Re: [PATCH V5] Btrfs: snapshot-aware defrag

2013-02-18 Thread Stefan Behrens
On Sat, 16 Feb 2013 14:47:45 +0800, Liu Bo wrote: > What about this patch(UNTESTED)? > > thanks, > liubo > > diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c > index ca7ace7..dac9d4b 100644 > --- a/fs/btrfs/inode.c > +++ b/fs/btrfs/inode.c > @@ -4142,9 +4142,14 @@ static void inode_tree_del(struc

Re: [PATCH V5] Btrfs: snapshot-aware defrag

2013-02-19 Thread Stefan Behrens
On 19.02.2013 05:29, Liu Bo wrote: On Mon, Feb 18, 2013 at 05:53:50PM +0100, Stefan Behrens wrote: On Sat, 16 Feb 2013 14:47:45 +0800, Liu Bo wrote: What about this patch(UNTESTED)? thanks, liubo diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index ca7ace7..dac9d4b 100644 --- a/fs/btrfs

Re: [PATCH, RFC] btrfs-progs: require mkfs -f force option to overwrite filesystem or partition table

2013-02-20 Thread Stefan Behrens
On Thu, 14 Feb 2013 12:30:03 -0600, Eric Sandeen wrote: > The core of this is shamelessly stolen from xfsprogs. > > Use blkid to detect an existing filesystem or partition > table on any of the target devices. If something is found, > require the '-f' option to overwrite it, hopefully avoiding >

[BUG] during balance operation, WARNING: at fs/btrfs/relocation.c:1624 replace_file_extents+0x74b/0x7e0 [btrfs]()

2013-03-04 Thread Stefan Behrens
Just ran the following command sequence and got lots of WARNINGs. The issue is reproducible. The box was running the cmason/for-linus that made it into Linux 3.9 RC1. #!/bin/sh mkfs.btrfs -f /dev/sdl /dev/sdk -m raid1 -d raid1 -l 16384 mount /dev/sdl /mnt dd if=/dev/urandom of=/mnt/urandom.1GB bs=

[PATCH] Btrfs: allow running defrag in parallel to administrative tasks

2013-03-04 Thread Stefan Behrens
exclusiveness as well. This is fixed with this commit. Signed-off-by: Stefan Behrens --- fs/btrfs/ioctl.c | 8 1 file changed, 8 deletions(-) diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index b908960..40631cf 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c @@ -2245,13 +2245,6 @@ static

Re: [BUG] during balance operation, WARNING: at fs/btrfs/relocation.c:1624 replace_file_extents+0x74b/0x7e0 [btrfs]()

2013-03-05 Thread Stefan Behrens
On Mon, 4 Mar 2013 14:31:37 -0500, Chris Mason wrote: > On Mon, Mar 04, 2013 at 10:24:39AM -0700, Stefan Behrens wrote: >> Just ran the following command sequence and got lots of WARNINGs. >> The issue is reproducible. >> The box was running the cmason/for-linus that made

Re: [BUG] during balance operation, WARNING: at fs/btrfs/relocation.c:1624 replace_file_extents+0x74b/0x7e0 [btrfs]()

2013-03-05 Thread Stefan Behrens
On Tue, 5 Mar 2013 15:36:33 +0100, David Sterba wrote: > On Mon, Mar 04, 2013 at 06:24:39PM +0100, Stefan Behrens wrote: >> Just ran the following command sequence and got lots of WARNINGs. >> The issue is reproducible. >> The box was running the cmason/for-linus that made

Re: [PATCH 3/3] xfstests: btrfs tests for basic informational commands

2013-03-13 Thread Stefan Behrens
On Wed, 13 Mar 2013 09:57:03 -0500, Eric Sandeen wrote: [...] > +echo "== Show device stats by mountpoint" > +$BTRFS_UTIL_PROG device stats $SCRATCH_MNT | _filter_btrfs_device_stats Is the number of devices in SCRATCH_DEV_POOL fixed to 3? Otherwise you should pipe the device-stats-by-mountpoint th

Re: [PATCH 3/3 V3] xfstests: btrfs tests for basic informational commands

2013-03-13 Thread Stefan Behrens
b/common.filter > index c854a98..c34809f 100644 > --- a/common.filter > +++ b/common.filter > @@ -226,6 +226,13 @@ _filter_scratch() > sed -e "s,$SCRATCH_DEV,SCRATCH_DEV,g" -e "s,$SCRATCH_MNT,SCRATCH_MNT,g" > } > > +# Turn any device in the scratc

Re: [PATCH 3/3 V4] xfstests: btrfs tests for basic informational commands

2013-03-14 Thread Stefan Behrens
On Thu, 14 Mar 2013 08:01:54 -0500, Rich Johnston wrote: > Thanks for reviewing this patch, may I put your Reviewed-by: on this > version? Yes. Thanks. Reviewed-by: Stefan Behrens -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a m

Re: Btrfs: add optional integrity check code

2014-05-09 Thread Stefan Behrens
On Fri, 9 May 2014 15:00:07 +0300, Dan Carpenter wrote: > Hello Stefan Behrens, > > The patch 5db0276014b8: "Btrfs: add optional integrity check code" > from Nov 1, 2011, leads to the following static checker warning: > > fs/btrfs/check-integrity.c:10

[PATCH] btrfs: check_int: propagate out-of-memory error upwards

2014-05-09 Thread Stefan Behrens
This issue was not causing any harm but IMO (and in the opinion of the static code checker) it is better to propagate this error status upwards. Signed-off-by: Stefan Behrens Reported-by: Dan Carpenter --- fs/btrfs/check-integrity.c | 5 - 1 file changed, 4 insertions(+), 1 deletion

Re: [PATCH] Btrfs-progs: save us an unnecessary ioctl call

2014-05-13 Thread Stefan Behrens
On Tue, 13 May 2014 17:05:05 +0800, Wang Shilong wrote: > Btrfs device id start from 1, not 0. > > Signed-off-by: Wang Shilong > --- > utils.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/utils.c b/utils.c > index 560c557..d480353 100644 > --- a/utils.c > +++ b/utils

Re: 1 week to rebuid 4x 3TB raid10 is a long time!

2014-07-22 Thread Stefan Behrens
On Tue, 22 Jul 2014 14:43:45 + (UTC), Tm wrote: > Wang Shilong cn.fujitsu.com> writes: > > >> The latest btrfs-progs include man page of btrfs-replace. Actually, you >> could use it >> something like: >> >> btrfs replace start | >> >> You could use 'btrfs file show' to see missing device

<    1   2   3   4   5   6   >