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 bo.li@oracle.com 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 bo.li@oracle.com wrote: On Tue, Jan 22, 2013 at 11:41:19AM

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 objections, I'd rather remove the source files as well

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

2013-01-21 Thread Stefan Behrens
-by: Stefan Behrens sbehr...@giantdisaster.de Signed-off-by: Goffredo Baroncellikreij...@inwind.it Signed-off-by: Gene Czarcinskig...@czarc.net -- To unsubscribe from this list: send the line unsubscribe linux-btrfs in the body of a message to majord...@vger.kernel.org More majordomo info at http

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

[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

[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-by: Stefan Behrens

[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 sbehr...@giantdisaster.de --- 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

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

[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 sbehr...@giantdisaster.de --- This patch is only for btrfs

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 available

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 Total

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

2012-11-14 Thread Stefan Behrens
a 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 m...@joerivanthienen.be Signed-off-by: Stefan Behrens sbehr...@giantdisaster.de --- This patch

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 the second new function btrfs_find_device_by_path

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 +0800, Liu Bo wrote: On Tue, Nov 06

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_transaction(root, 0); why

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 that

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:

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

2012-11-08 Thread Stefan Behrens
Behrens 2012-11-05 470 } d8e784f5 Stefan Behrens 2012-11-05 471 ret = btrfs_commit_transaction(trans, root); d8e784f5 Stefan Behrens 2012-11-05 472 WARN_ON(ret); d8e784f5 Stefan Behrens 2012-11-05 473 d8e784f5 Stefan Behrens 2012-11-05 474 /* keep away

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) will do release for you :) Right :) Thanks. +int

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 = sctx-wr_ctx; +struct scrub_bio

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] path srcdev|devid targetdev I think that btrfs replace start [-Bfr] srcdev|devid targetdev path of the same synopsis as other subcommands is better. You are right. 'btrfs

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

2012-11-06 Thread Stefan Behrens
to 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 sbehr...@giantdisaster.de --- fs/btrfs/super.c | 11 ++- 1 file changed, 10 insertions(+), 1

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

2012-11-06 Thread Stefan Behrens
to 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 sbehr...@giantdisaster.de --- fs/btrfs/ctree.h | 3 +++ fs/btrfs/reada.c | 3

[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 sbehr...@giantdisaster.de --- fs/btrfs/ctree.h | 2 +- fs/btrfs/extent-tree.c | 3 ++- fs/btrfs/ioctl.c | 8 +++- fs/btrfs

[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 sbehr...@giantdisaster.de --- fs/btrfs/ctree.h | 11 fs/btrfs/disk-io.c | 4 +-- fs/btrfs/ioctl.c | 8 +++--- fs/btrfs/scrub.c | 76 -- 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 sbehr...@giantdisaster.de --- 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

[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 sbehr...@giantdisaster.de --- fs/btrfs/scrub.c | 106 +-- 1 file changed, 71 insertions(+), 35 deletions(-) diff --git a/fs/btrfs/scrub.c b/fs

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

2012-11-06 Thread Stefan Behrens
Signed-off-by: Stefan Behrens sbehr...@giantdisaster.de --- 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

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

2012-11-06 Thread Stefan Behrens
be used to read data in order to repair read errors on other disks. Signed-off-by: Stefan Behrens sbehr...@giantdisaster.de --- 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

[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 sbehr...@giantdisaster.de --- fs/btrfs/check-integrity.c | 2 +- fs

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

2012-11-06 Thread Stefan Behrens
a running device replace 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

[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 sbehr...@giantdisaster.de --- fs/btrfs/scrub.c | 504 ++--- fs/btrfs/volumes.h | 2 +- 2 files changed, 253 insertions(+), 253 deletions(-) diff

[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 sbehr...@giantdisaster.de --- fs/btrfs/volumes.c | 74

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

2012-11-06 Thread Stefan Behrens
, 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 sbehr...@giantdisaster.de --- fs/btrfs/check-integrity.c | 15

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

2012-11-06 Thread Stefan Behrens
Signed-off-by: Stefan Behrens sbehr...@giantdisaster.de --- 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

[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 sbehr...@giantdisaster.de --- fs/btrfs/Makefile | 2 +- fs/btrfs/ctree.h | 2 + fs/btrfs/disk-io.c | 24 +- fs/btrfs/reada.c

[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 sbehr...@giantdisaster.de --- 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 sbehr...@giantdisaster.de --- fs/btrfs/check-integrity.c | 12 ++-- fs/btrfs/disk-io.c | 2 +- fs/btrfs/extent_io.c | 11 +-- fs/btrfs/volumes.c | 3 ++- fs

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

[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 sbehr...@giantdisaster.de --- 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

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

2012-11-06 Thread Stefan Behrens
-by: Stefan Behrens sbehr...@giantdisaster.de --- 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

[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 sbehr...@giantdisaster.de --- fs/btrfs/dev-replace.c | 843 + fs/btrfs/dev

[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 sbehr...@giantdisaster.de --- 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

[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 sbehr...@giantdisaster.de --- 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

[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 sbehr...@giantdisaster.de --- fs/btrfs/ctree.h | 2 + fs/btrfs/reada.c | 10 +- fs/btrfs/scrub.c | 881

[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
is not changed by this commit. Signed-off-by: Stefan Behrens sbehr...@giantdisaster.de --- 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

[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-by: Stefan Behrens

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’:

[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 Behrens sbehr

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 kreij...@inwind.it --- Makefile |5 +- btrfs-show-super.c | 284 2 files changed, 288 insertions(+), 1 deletion(-) create mode 100644

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 kreij...@inwind.it --- Makefile |5 +- btrfs-show-super.c | 284 2 files changed, 288 insertions(+), 1 deletion(-) create mode 100644

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

2012-10-31 Thread Stefan Behrens
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 stats. The definition of the function open_file_or_dir() is moved

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

2012-10-30 Thread Stefan Behrens
with the 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 sbehr...@giantdisaster.de --- fs/btrfs

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-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 sbehr...@giantdisaster.de --- Makefile | 5 +- btrfs-show-super.c | 201 + 2 files changed, 205 insertions(+), 1 deletion(-) diff --git

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

2012-10-15 Thread Stefan Behrens
parameter list would also be a working workaround. Signed-off-by: Stefan Behrens sbehr...@giantdisaster.de --- 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

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 kreij...@inwind.it 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

Re: [PATCH] Btrfs: fix page leakage

2012-10-11 Thread Stefan Behrens
On Fri, 5 Oct 2012 16:55:00 -0400, Josef Bacik wrote: Alloc_dummy_extent_buffer will not free the first page in the eb array if we fail to allocate a page, fix this. Thanks, Reported-by: David Sterba d...@jikos.cz Signed-off-by: Josef Bacik jba...@fusionio.com --- fs/btrfs/extent_io.c |

[PATCH] Btrfs: Fix wrong error handling code

2012-10-11 Thread Stefan Behrens
gcc says warning: comparison of unsigned expression = 0 is always true because i is an unsigned long. And gcc is right this time. Signed-off-by: Stefan Behrens sbehr...@giantdisaster.de --- fs/btrfs/extent_io.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/btrfs

Re: [PATCH] Btrfs: make filesystem read-only when submitting barrier fails

2012-10-05 Thread Stefan Behrens
On Fri, 10 Aug 2012 15:38:35 +0200, Stefan Behrens wrote: So far the return code of barrier_all_devices() is ignored, which means that errors are ignored. The result can be a corrupt filesystem which is not consistent. This commit adds code to evaluate the return code of barrier_all_devices

Re: [PATCH] Btrfs: make filesystem read-only when submitting barrier fails

2012-10-05 Thread Stefan Behrens
On Fri, 5 Oct 2012 09:09:11 -0400, Chris Mason wrote: On Fri, Oct 05, 2012 at 06:51:59AM -0600, Josef Bacik wrote: On Fri, Aug 10, 2012 at 07:38:35AM -0600, Stefan Behrens wrote: So far the return code of barrier_all_devices() is ignored, which means that errors are ignored. The result can

Re: kernel BUG at fs/btrfs/extent_io.c:1884!

2012-09-20 Thread Stefan Behrens
On 09/21/2012 05:46, Marc MERLIN wrote: Oh my, now I'm trying again with a new drive, and a big cp from an existing array to a new one dies with: [32042.079411] [ cut here ] [32042.085799] kernel BUG at fs/btrfs/extent_io.c:1884! [32042.092528] invalid opcode: [#1]

Re: [PATCH] Btrfs: cleanup of error processing in btree_get_extent()

2012-09-12 Thread Stefan Behrens
On Wed, 12 Sep 2012 17:26:43 +0900, Tsutomu Itoh wrote: This patch simplifies a little complex error processing in btree_get_extent(). Signed-off-by: Tsutomu Itoh t-i...@jp.fujitsu.com --- fs/btrfs/disk-io.c | 14 +- 1 files changed, 5 insertions(+), 9 deletions(-) diff

Re: crash while trying to access corrupt fs

2012-08-27 Thread Stefan Behrens
On Sun, 26 Aug 2012 16:07:33 -0400 (EDT), tubalcane wrote: I'm primarily interested in the block level checksums of files and the scrubbing feature to detect corrupt files. Currently I use ext4 and create and keep md5sums of everything which is tedious but I care about my data (quadruple

[PATCH] Btrfs: revert checksum error statistic which can cause a BUG()

2012-08-27 Thread Stefan Behrens
is reverted with the current patch. However, the counting of checksum errors in the scrub context remains active, and the counting of detected IO errors (read, write or flush errors) in all contexts remains active. Cc: stable sta...@vger.kernel.org # 3.5 Signed-off-by: Stefan Behrens sbehr

Re: crash while trying to access corrupt fs

2012-08-27 Thread Stefan Behrens
On Mon, 27 Aug 2012 23:31:41 +0800, Liu Bo wrote: On 08/27/2012 07:12 PM, Stefan Behrens wrote: On Sun, 26 Aug 2012 16:07:33 -0400 (EDT), tubalcane wrote: I'm primarily interested in the block level checksums of files and the scrubbing feature to detect corrupt files. Currently I use ext4

Re: [PATCH v0 1/4] Add support for sysfs to btrfs.

2012-08-23 Thread Stefan Behrens
On Thu, 23 Aug 2012 14:12:59 +0200, Goffredo Baroncelli wrote: Export via sysfs some information about the btrfs devices and filesystem. --- fs/btrfs/super.c |4 fs/btrfs/sysfs.c | 933 ++ fs/btrfs/sysfs.h | 31 ++ 3 files

Re: kernel BUG at fs/btrfs/extent_io.c:1884 - BTRFS

2012-08-15 Thread Stefan Behrens
On Wed, 15 Aug 2012 10:21:48 -0500, Anthony Plack wrote: Okay, this is the second occurrence of this bug. I have searched Google, and while there are two posting for exten_io, I am not sure if they match. Running Gentoo with kernel 3.5 on a dual core AMD. The machine has 19 drives of

Re: [PATCH] Btrfs: make filesystem read-only when submitting barrier fails

2012-08-13 Thread Stefan Behrens
On Sat, 11 Aug 2012 10:36:17 +0800, Liu Bo wrote: On 08/10/2012 09:38 PM, Stefan Behrens wrote: [...] +flags = space.flags; +/* + * return + * 0: if dup, single or RAID0

[PATCH] Btrfs: make filesystem read-only when submitting barrier fails

2012-08-10 Thread Stefan Behrens
is started and finished, and when devices are added or removed. Signed-off-by: Stefan Behrens sbehr...@giantdisaster.de --- fs/btrfs/ctree.h| 5 +++ fs/btrfs/disk-io.c | 109 +--- fs/btrfs/disk-io.h | 2 + fs/btrfs/ioctl.c| 8 ++-- fs/btrfs

[PATCH] Btrfs: fix that repair code is spuriously executed for transid failures

2012-08-10 Thread Stefan Behrens
repair_eb_io_failure() when the verification of the transids failed. This commit fixes the issue. Signed-off-by: Stefan Behrens sbehr...@giantdisaster.de --- fs/btrfs/disk-io.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 3c4c439

[BUG] kernel stack overflow on mount

2012-08-09 Thread Stefan Behrens
This issue happens every time I want to mount one particular filesystem. To create the filesystem, I was using 'mkfs.btrfs -d raid1 -m raid1', mounted it and copied the kernel sources into the filesystem, then ran 'btrfs balance', 'btrfs dev add' and 'btrfs dev del'. The last step was the dev

[BUG] btrfs dev del causes 'possible circular locking dependency detected'

2012-08-09 Thread Stefan Behrens
With chris' for-linus of today. The script: echo /dev/sdo, /dev/sdp and /dev/sdq are 1TB disks mkfs.btrfs -d raid1 -m raid1 -b1600M /dev/sdo /dev/sdp mount /dev/sdo /mnt2 echo 'copy kernel source and built kernel objects (much larger than 1600MB):' (cd ~/git/btrfs; tar cf - .) | (cd /mnt2; tar xf

Re: [BUG] btrfs dev del causes 'possible circular locking dependency detected'

2012-08-09 Thread Stefan Behrens
On Thu, 9 Aug 2012 18:01:57 +0200, David Sterba wrote: On Thu, Aug 09, 2012 at 05:36:54PM +0200, Stefan Behrens wrote: Aug 9 16:02:21 qvarne kernel: [ 543.479460] - #2 (fs_info-cleaner_mutex){+.+...}: Aug 9 16:02:21 qvarne kernel: [ 543.541341][810da005] lock_acquire

Re: kernel BUG at fs/btrfs/extent-tree.c:5038 (linux 3.4.7)

2012-08-08 Thread Stefan Behrens
On Wed, 8 Aug 2012 16:45:57 +0200, David Sterba wrote: On Sun, Aug 05, 2012 at 04:11:47PM +0200, Olivier Bonvalet wrote: Aug 5 16:10:12 backup2 kernel: [ 58.674758] parent transid verify failed on 615015833600 wanted 110423 found 110424 1st mirror fails verify_parent_transid(). Aug 5

[PATCH RESEND] Btrfs: fix that error value is changed by mistake

2012-08-01 Thread Stefan Behrens
In iterate_inodes_from_logical() the error result from extent_from_logical() is patched by mistake. Typically ENOENT is patched to EINVAL because (-ENOENT BTRFS_EXTENT_FLAG_TREE_BLOCK) evaluates to true. Signed-off-by: Stefan Behrens sbehr...@giantdisaster.de --- Resent because of the previously

[PATCH v2] Btrfs: remove superblock writing after fatal error

2012-08-01 Thread Stefan Behrens
sleep 35 echo 0 25165824 linear $SCRATCH_DEV 0 | dmsetup reload foo dmsetup resume foo sleep 1 umount $SCRATCH_MNT btrfsck /dev/mapper/foo dmsetup remove foo Signed-off-by: Stefan Behrens sbehr...@giantdisaster.de Signed-off-by: Jan Schmidt list.bt...@jan-o-sch.net --- Changes v1 - v2: - Removed

[PATCH] Btrfs: detect corrupted filesystem after write I/O errors

2012-07-31 Thread Stefan Behrens
In check-integrity, detect when a superblock is written that points to blocks that have not been written to disk due to I/O write errors. Signed-off-by: Stefan Behrens sbehr...@giantdisaster.de --- fs/btrfs/check-integrity.c | 16 ++-- 1 file changed, 14 insertions(+), 2 deletions

[RFC PATCH] Btrfs: remove superblock writing after fatal error

2012-07-31 Thread Stefan Behrens
umount $SCRATCH_MNT btrfsck /dev/mapper/foo dmsetup remove foo Signed-off-by: Stefan Behrens sbehr...@giantdisaster.de --- fs/btrfs/disk-io.c | 11 +++ 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 502b20c..6f08a32 100644 --- a/fs

Re: [PATCH] btrfs-progs: btrfs-image.c: Added NULL pointer check.

2012-07-27 Thread Stefan Behrens
On Fri, 27 Jul 2012 16:04:14 +0530, Nageswara R Sastry wrote: Check for the return value of 'open_ctree()' before dereferencing it. Signed-off-by: Nageswara R Sastry nasas...@in.ibm.com --- btrfs-image.c | 1 + 1 file changed, 1 insertion(+) diff --git a/btrfs-image.c b/btrfs-image.c

Re: [PATCH] btrfs-progs: btrfs-image.c: Added NULL pointer check.

2012-07-27 Thread Stefan Behrens
On Fri, 27 Jul 2012 13:09:53 +0200, Stefan Behrens wrote: On Fri, 27 Jul 2012 16:04:14 +0530, Nageswara R Sastry wrote: Check for the return value of 'open_ctree()' before dereferencing it. Signed-off-by: Nageswara R Sastry nasas...@in.ibm.com --- btrfs-image.c | 1 + 1 file changed, 1

[PATCH] Btrfs: fix that error value is changed by mistake

2012-07-27 Thread Stefan Behrens
In iterate_inodes_from_logical() the error result from extent_from_logical() is patched by mistake. Typically ENOENT is patched to EINVAL because (-ENOENT BTRFS_EXTENT_FLAG_TREE_BLOCK) evaluates to true. --- fs/btrfs/backref.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git

[PATCH] Btrfs: fix a misplaced address operator in a condition

2012-07-26 Thread Stefan Behrens
This should obviously not be if (flag) but if (flag). Signed-off-by: Stefan Behrens sbehr...@giantdisaster.de --- fs/btrfs/locking.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/btrfs/locking.c b/fs/btrfs/locking.c index a44eff074..2a1762c 100644 --- a/fs/btrfs

[PATCH 0/2] Btrfs: remove unwanted kernel log output

2012-07-17 Thread Stefan Behrens
People complained about unwanted kernel log output at mount time, related to btrfs device I/O statistics. With these two commits, the two messages are removed or filtered, respectively. Stefan Behrens (2): Btrfs: remove unwanted printk() for btrfs device I/O stats Btrfs: suppress printk

[PATCH 2/2] Btrfs: suppress printk() if all device I/O stats are zero

2012-07-17 Thread Stefan Behrens
Code is added to suppress the I/O stats printing at mount time if all statistic values are zero. Signed-off-by: Stefan Behrens sbehr...@giantdisaster.de --- fs/btrfs/volumes.c | 8 1 file changed, 8 insertions(+) diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 6f04dae

[PATCH 1/2] Btrfs: remove unwanted printk() for btrfs device I/O stats

2012-07-17 Thread Stefan Behrens
it is now will be used also in the future. Then this message is not useful to find errors, it is just annoying. This commit removes the printk(). Signed-off-by: Stefan Behrens sbehr...@giantdisaster.de --- fs/btrfs/volumes.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/fs/btrfs/volumes.c b/fs

Re: kernel BUG at fs/btrfs/extent_io.c:1893!

2012-07-10 Thread Stefan Behrens
On Tue, 10 Jul 2012 09:48:27 +1000, Shavi N wrote: Hi, I have this problem after trying to run btrfsck. I have new 11 HDDs WD 2tb, on two RAID controllers Arch Linux, latest kernel. What I was doing was copying and reading multiple data at the same time After getting I/O errors while

[PATCH] Btrfs: avoid I/O repair BUG() from btree_read_extent_buffer_pages()

2012-07-10 Thread Stefan Behrens
blocks. This commit prevents calling repair_io_failure() in this case and thus avoids the BUG_ON() and malfunction. Signed-off-by: Stefan Behrens sbehr...@giantdisaster.de --- fs/btrfs/disk-io.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk

Re: Testing permanent IO errors with btrfs

2012-07-03 Thread Stefan Behrens
On Mon, 2 Jul 2012 22:57:01 +0300, Alex Lyakas wrote: Hi everybody, I am interested to test how btrfs behaves when the underlying block device starts returning permanent IO errors. To test this, I set up a linear device-mapper, mapped to the block device and start IOs. At some point, I switch

Re: Testing permanent IO errors with btrfs

2012-07-03 Thread Stefan Behrens
On Tue, 03 Jul 2012 16:02:03 +0200, Stefan Behrens wrote: On 7/3/2012 4:02 PM, Stefan Behrens wrote: On Mon, 2 Jul 2012 22:57:01 +0300, Alex Lyakas wrote: Hi everybody, I am interested to test how btrfs behaves when the underlying block device starts returning permanent IO errors. To test

[PATCH] Btrfs-progs: join DEV_STATS ioctls to one

2012-07-03 Thread Stefan Behrens
. Signed-off-by: Stefan Behrens sbehr...@giantdisaster.de --- cmds-device.c | 13 ++--- ioctl.h | 4 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/cmds-device.c b/cmds-device.c index 7621cc0..c146e91 100644 --- a/cmds-device.c +++ b/cmds-device.c @@ -263,13 +263,13

Re: [PATCH] btrfs: join DEV_STATS ioctls to one

2012-06-22 Thread Stefan Behrens
and should not waste ioctl numbers. CC: Stefan Behrens sbehr...@giantdisaster.de Signed-off-by: David Sterba dste...@suse.cz --- fs/btrfs/ioctl.c | 16 fs/btrfs/ioctl.h |6 -- fs/btrfs/volumes.c |5 ++--- fs/btrfs/volumes.h |3 +-- 4 files changed, 15

Re: [PATCH] btrfs: join DEV_STATS ioctls to one

2012-06-22 Thread Stefan Behrens
On 06/22/2012 19:02 +0200, David Sterba wrote: On Fri, Jun 22, 2012 at 06:26:44PM +0200, Stefan Behrens wrote: I still do not understand your reason and the benefit of your change. The reset command and the read command are two completely different operations. Therefore I assigned two different

[PATCH] Btrfs: don't count I/O statistic read errors for missing devices

2012-06-14 Thread Stefan Behrens
fixes the issue. Signed-off-by: Stefan Behrens sbehr...@giantdisaster.de Reported-by: Carey Underwood cwi...@cwillu.com --- fs/btrfs/volumes.c | 22 -- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 7782020

Re: [PATCH 1/2] Btrfs: use rcu to protect device-name V2

2012-06-13 Thread Stefan Behrens
On Wed, 13 Jun 2012 00:35:26 +0200, David Sterba wrote: On Tue, Jun 12, 2012 at 03:50:41PM -0400, Josef Bacik wrote: +++ b/fs/btrfs/check-integrity.c @@ -93,6 +93,7 @@ #include print-tree.h #include locking.h #include check-integrity.h +#include rcu-string.h #define

Re: [PATCH 1/2] Btrfs: use rcu to protect device-name V2

2012-06-13 Thread Stefan Behrens
On Wed, 13 Jun 2012 09:14:27 -0400, Josef Bacik wrote: On Wed, Jun 13, 2012 at 12:35:26AM +0200, David Sterba wrote: On Tue, Jun 12, 2012 at 03:50:41PM -0400, Josef Bacik wrote: @@ -4694,8 +4716,11 @@ int btrfs_init_dev_stats(struct btrfs_fs_info *fs_info) key.offset =

<    1   2   3   4   5   >