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 =

[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 Reported-by: Carey Underwood --- 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..19b51ad 100644 --- a/fs/btrfs/volumes.c +++ b

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

2012-06-22 Thread Stefan Behrens
think we > should use a more clean way to pass flags and should not waste ioctl > numbers. > > CC: Stefan Behrens > Signed-off-by: David Sterba > --- > fs/btrfs/ioctl.c | 16 > fs/btrfs/ioctl.h |6 -- > fs/btrfs/volumes.c |5 ++---

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

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 sw

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 pe

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

2012-07-03 Thread Stefan Behrens
. Signed-off-by: Stefan Behrens --- 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 @@ static int

Re: [PATCH 1/3] btrfs: extended inode refs

2012-07-06 Thread Stefan Behrens
On Fri, 06 Jul 2012 16:56:40 +0200, Jan Schmidt wrote: > On Mon, May 21, 2012 at 23:46 (+0200), Mark Fasheh wrote: >> +int find_name_in_ext_backref(struct btrfs_path *path, const char *name, >> + int name_len, >> + struct btrfs_inode_extref **extref_r

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
ite disk blocks. This commit prevents calling repair_io_failure() in this case and thus avoids the BUG_ON() and malfunction. Signed-off-by: Stefan Behrens --- 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-io.c index 8cc4

[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() if

[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 --- fs/btrfs/volumes.c | 8 1 file changed, 8 insertions(+) diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 6f04dae..d11606c 100644 --- a/fs/btrfs

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

2012-07-17 Thread Stefan Behrens
like 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 --- fs/btrfs/volumes.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volum

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

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 > --- > btrfs-image.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/btrfs-image.c b/btrfs-image.c > index f2bbcc

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 >> --- >> btrfs-im

[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: 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 --- fs/btrfs/check-integrity.c | 16 ++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/fs/btrfs

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

2012-07-31 Thread Stefan Behrens
resume foo sleep 1 umount $SCRATCH_MNT btrfsck /dev/mapper/foo dmsetup remove foo Signed-off-by: Stefan Behrens --- 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/btrfs/

[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 --- Resent because of the previously forgotten Signed-of

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

2012-08-01 Thread Stefan Behrens
ATCH_MNT 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 Signed-off-by: Jan Schmidt --- Changes v1 -> v2: - Removed one large comment entirely which was

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

2012-08-01 Thread Stefan Behrens
On Wed, 01 Aug 2012 21:31:58 +0800, Liu Bo wrote: > On 08/01/2012 09:07 PM, Jan Schmidt wrote: >> On Wed, August 01, 2012 at 14:02 (+0200), Liu Bo wrote: >>> On 08/01/2012 07:45 PM, Stefan Behrens wrote: >>>> With commit acce952b0, btrfs was chang

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

2012-08-02 Thread Stefan Behrens
On Wed, 01 Aug 2012 16:31:54 +0200, Stefan Behrens wrote: > On Wed, 01 Aug 2012 21:31:58 +0800, Liu Bo wrote: >> On 08/01/2012 09:07 PM, Jan Schmidt wrote: >>> On Wed, August 01, 2012 at 14:02 (+0200), Liu Bo wrote: >>>> On 08/01/2012 07:45 PM, Stefan Behrens wrot

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

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

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

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

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

[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 --- 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..29c69e6 100644 --- a/fs

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:

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 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 file

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
That part 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 # 3.5 Signed-off-by: Stefan Behrens --- fs/btrfs/extent

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 >>> feat

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 > --- > fs/btrfs/disk-io.c | 14 +- > 1 files changed, 5 insertions(+), 9 deletions(-) > > diff --git a/fs/btr

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] PR

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 re

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 t

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 > Signed-off-by: Josef Bacik > --- > fs/btrfs/extent_io.c |2 +- > 1 files changed

[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 --- fs/btrfs/extent_io.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/btrfs/extent_io

[PATCH V2] xfstests: don't remove the two first devices from SCRATCH_DEV_POOL

2013-08-19 Thread Stefan Behrens
can only guess) to allow to pass the SCRATCH_DEV_POOL as an argument to _scratch_mkfs. Since _scratch_mkfs adds the SCRATCH_DEV, the pool mustn't contain that device anymore. A new function _scratch_pool_mkfs is introduced that does the expected thing. Signed-off-by: Stefan Behrens --- V1

[PATCH V3] xfstests: don't remove the two first devices from SCRATCH_DEV_POOL

2013-08-19 Thread Stefan Behrens
can only guess) to allow to pass the SCRATCH_DEV_POOL as an argument to _scratch_mkfs. Since _scratch_mkfs adds the SCRATCH_DEV, the pool mustn't contain that device anymore. A new function _scratch_pool_mkfs is introduced that does the expected thing. Signed-off-by: Stefan Behrens --- V1

[PATCH V3] xfstests: add a test for btrfs device replace operation

2013-08-19 Thread Stefan Behrens
minates with _notrun. To check the filesystems after replacing a device, a scrub run is performed, a btrfsck run, and finally the filesystem is remounted. This commit depends on my other commit: "xfstest: don't remove the two first devices from SCRATCH_DEV_POOL" Signed-off-by: Stefan

[PATCH V4] xfstests: add a test for btrfs device replace operation

2013-08-19 Thread Stefan Behrens
minates with _notrun. To check the filesystems after replacing a device, a scrub run is performed, a btrfsck run, and finally the filesystem is remounted. This commit depends on my other commit: "xfstest: don't remove the two first devices from SCRATCH_DEV_POOL" Signed-off-by: Stefan

[PATCH] Btrfs: don't allow the replace procedure on read only filesystems

2013-08-19 Thread Stefan Behrens
device (with mkfs or with a hammer). The next mount fails with "failed to read chunk root" and the filesystem is gone. This commit adds code to fail the attempt to start the replace procedure if the filesystem is mounted read-only. Signed-off-by: Stefan Behrens Cc: # 3.10+ --- fs/btr

Re: [PATCH] Btrfs: fix some basic sparse errors

2013-08-19 Thread Stefan Behrens
On 08/19/2013 20:21, Josef Bacik wrote: Running sparse I found a few small things where we should have static functions that aren't used externally and we should be using unsigned values for bit fields. Thanks, Signed-off-by: Josef Bacik --- fs/btrfs/disk-io.c |8 fs/btrfs/send

Re: [PATCH] xfstests: add regression test for kernel bz 60673 V2

2013-08-20 Thread Stefan Behrens
On Mon, 19 Aug 2013 16:53:17 -0400, Josef Bacik wrote: > There was a problem with send trying to overwrite a file that wasn't actually > the same. This is a test to check this particular case where receive fails > when > it should succeed properly. I tested this to verify it fails without my fix

Re: uncorrectable errors after btrfs replace

2013-08-20 Thread Stefan Behrens
On Mon, 19 Aug 2013 00:35:54 +0200, Stuart Pook wrote: > hi Chris > > thanks for your reply. I was unable to save the filesystem. Even after > deleting all but 4Gb I still had too many errors so I just reformated > the device. I'm glad that it was my backups and not my data. > > On 18/08/13 23:4

Re: uncorrectable errors after btrfs replace

2013-08-20 Thread Stefan Behrens
On Tue, 20 Aug 2013 15:52:27 +0200, slp644161 wrote: > Stefan Behrens wrote: > >> Do you still have the kernel log files around that had been written >> while you ran the replace procedure? /var/log/messages*. Could you >> share >> these files (via personal

Re: uncorrectable errors after btrfs replace

2013-08-20 Thread Stefan Behrens
On Tue, 20 Aug 2013 16:46:59 +0200, slp644161 wrote: > Chris Murphy wrote: > >>> I ran a badblocks scan on the raw device (not the luks device) and >> didn't get any errors. >> >> badblocks will depend on the drive determining a persistent read >> failure with a sector, and timing out before the

Re: [PATCH] btrfs: introduce BTRFS_IOC_CHECK_DEV_EXCL_OPS ioctl to check dev excl op

2013-08-21 Thread Stefan Behrens
On Wed, 21 Aug 2013 21:10:42 +0800, Anand Jain wrote: > This patch provides an ioctl to check if the FS is performing > any device exclusive operations like device add remove balance > etc. Basically any operation which will set > fs_info->mutually_exclusive_operation_running to true > > This will

Re: [PATCH] btrfs: introduce BTRFS_IOC_CHECK_DEV_EXCL_OPS ioctl to check dev excl op

2013-08-22 Thread Stefan Behrens
On Thu, 22 Aug 2013 17:51:37 +0800, anand jain wrote: > > Thanks for reviewing. Comments below. > >> IMHO this is just a workaround for a design flaw. > > Its a simple fix on the lines of current design. > >> Now it is like this (in the replace CLI without the "do not background" >> option): >

Re: [PATCH 2/4] Btrfs: add btrfs_alloc_device and switch to it

2013-08-23 Thread Stefan Behrens
On Mon, 12 Aug 2013 14:33:02 +0300, Ilya Dryomov wrote: > Currently btrfs_device is allocated ad-hoc in a few different places, > and as a result not all fields are initialized properly. In particular, > readahead state is only initialized in device_list_add (at scan time), > and not in btrfs_init

[PATCH 2/2] Btrf: cleanup: don't check for root_refs == 0 twice

2013-08-23 Thread Stefan Behrens
btrfs_read_fs_root_no_name() already checks if btrfs_root_refs() is zero and returns ENOENT in this case. There is no need to do it again in three more places. Signed-off-by: Stefan Behrens --- fs/btrfs/file.c | 5 - fs/btrfs/relocation.c | 3 --- fs/btrfs/scrub.c | 5 - 3

[PATCH 1/2] Btrfs: fix for patch "cleanup: don't check the same thing twice"

2013-08-23 Thread Stefan Behrens
retrieve the root, because this check was already dealt with in btrfs_read_fs_root_no_name(). But in the case when the root was found in the cache, there was no such check. This patch adds the missing check in the case where the root is found in the cache. Reported-by: Mitch Harder Signed-off-by: Stefan

Re: Kernel BUG on Snapshot Deletion (3.11.0-rc5)

2013-08-23 Thread Stefan Behrens
On Wed, 21 Aug 2013 08:44:55 -0500, Mitch Harder wrote: > I've had a hard time assembling a portable reproducer for this issue. > > I discovered that my reproducer was highly dependent on a local > archive of out-of-date git kernel sources. My efforts to reproduce > the error with a portable set

Re: [PATCH] Btrfs: don't allow the replace procedure on read only filesystems

2013-08-23 Thread Stefan Behrens
On Fri, 23 Aug 2013 14:54:50 +0800, Wang Shilong wrote: > Hey Stefan, > > On 08/20/2013 12:51 AM, Stefan Behrens wrote: >> If you start the replace procedure on a read only filesystem, at >> the end the procedure fails to write the updated dev_items to the >> chunk tre

Re: [PATCH] xfstests: update filters and output of btrfs/006

2013-08-23 Thread Stefan Behrens
On Fri, 16 Aug 2013 12:10:31 -0500, Eric Sandeen wrote: > On 8/16/13 12:02 PM, Stefan Behrens wrote: >> The btrfs-progs tools changed the output: >> - 100GiB instead of 100GB >> - The number of spaces was changed > > ugh. > >> >> Signed-off-by: Stefan Be

[PATCH V4] xfstests: don't remove the two first devices from SCRATCH_DEV_POOL

2013-08-23 Thread Stefan Behrens
can only guess) to allow to pass the SCRATCH_DEV_POOL as an argument to _scratch_mkfs. Since _scratch_mkfs adds the SCRATCH_DEV, the pool mustn't contain that device anymore. A new function _scratch_pool_mkfs is introduced that does the expected thing. Signed-off-by: Stefan Behrens --- V1

[PATCH] xfstest: fix btrfs/006 for 10+ devices in SCRATCH_DEV_POOL

2013-08-23 Thread Stefan Behrens
One problem was the output of "uniq -c" which added spaces depending on the size of the count value (e.g. one space less for 10+ devices). The second problem was that "btrfs fi show" was doing the same: "devid %4llu size %s used %s path %s". Signed-off-b

[PATCH][RESEND] xfstests: add a test for btrfs device replace operation

2013-08-23 Thread Stefan Behrens
minates with _notrun. To check the filesystems after replacing a device, a scrub run is performed, a btrfsck run, and finally the filesystem is remounted. This commit depends on my other commit: "xfstest: don't remove the two first devices from SCRATCH_DEV_POOL" Signed-off-by: Stefan

[PATCH] xfstests: update _filter_size() for Btrfs

2013-08-23 Thread Stefan Behrens
From: root The btrfs-progs tools changed the output: - 100GiB instead of 100GB xfstest btrfs/006 is one that failed due to this change. Signed-off-by: Stefan Behrens --- common/filter | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/filter b/common/filter index

Re: uncorrectable errors after btrfs replace

2013-09-02 Thread Stefan Behrens
On Sun, 25 Aug 2013 20:07:32 -0600, Chris Murphy wrote: > On Aug 25, 2013, at 4:10 PM, Stuart Pook wrote: >> >> I emailed them to Stefan Behrens & Chris Murphy. Please let me know if you >> did not get them (presumably because they are too big). > > Observation

[PATCH v2] Btrfs: get rid of one BUG() in write_all_supers()

2013-09-03 Thread Stefan Behrens
The second round uses btrfs_error() and return -EIO, the first round can handle write errors the same way. Signed-off-by: Stefan Behrens --- v1 -> v2: Add the missing mutex_unlock(). This missing unlock was reported by the 0-DAY kernel build service from Intel and found by the coccinelle t

Re: [PATCH] btrfs: add ability to query/change feature bits online

2013-09-03 Thread Stefan Behrens
On Tue, 27 Aug 2013 15:17:54 -0400, Jeff Mahoney wrote: > There are some feature bits that require no offline setup and can > be enabled online. I've only reviewed extended irefs, but there will > probably be more. > > We introduce three new ioctls: > - BTRFS_IOC_GET_SUPPORTED_FEATURES: query the

[PATCH] btrfs: show compiled-in config features at module load time

2013-09-03 Thread Stefan Behrens
We want to know if there are debugging features compiled in, this may affect performance. The message is printed before the sanity checks. (This commit message is a copy of David Sterba's commit message when he introduced btrfs_print_info()). Signed-off-by: Stefan Behrens --- fs/btrfs/su

Re: [PATCH] Btrfs: do not add replace target to the alloc_list

2013-09-04 Thread Stefan Behrens
nst that, > but ->is_tgtdev_for_dev_replace is (and can only ever be) initialized > *after* everything is opened and fs_devices lists are populated. Fix > this by checking the devid instead: for replace targets it's always > equal to BTRFS_DEV_REPLACE_DEVID. > > Cc: Stefan Behrens > S

Re: [PATCH 5/5] btrfs-progs:free strdup()s that are not freed

2013-09-05 Thread Stefan Behrens
On Thu, 5 Sep 2013 10:38:58 +0800, Gui Hecheng wrote: > The strdup()s not freed are reported as memory leaks by valgrind. > > Signed-off-by: Gui Hecheng > --- > cmds-subvolume.c | 48 ++-- > 1 file changed, 34 insertions(+), 14 deletions(-) > > diff -

Re: [PATCH 5/5] btrfs-progs:free strdup()s that are not freed

2013-09-05 Thread Stefan Behrens
On Thu, 05 Sep 2013 09:00:07 +0200, Stefan Behrens wrote: > On Thu, 5 Sep 2013 10:38:58 +0800, Gui Hecheng wrote: >> The strdup()s not freed are reported as memory leaks by valgrind. >> >> Signed-off-by: Gui Hecheng >> --

Re: [PATCH 18/20] Btrfs-progs: fix magic return value in cmds-balance.c

2013-09-05 Thread Stefan Behrens
On Thu, 05 Sep 2013 15:44:11 +0800, Wang Shilong wrote: [..] >>> @@ -297,9 +305,10 @@ static int do_balance(const char *path, struct >>> btrfs_ioctl_balance_args *args, >>> DIR *dirstream = NULL; >>> >>> fd = open_file_or_dir(path, &dirstream); >>> + e = errno; >>>

Re: [PATCH 3/3] Btrfs: fix several potential problems in copy_nocow_pages_for_inode

2013-09-05 Thread Stefan Behrens
On Thu, 27 Jun 2013 18:51:00 +0800, Miao Xie wrote: > - It makes no sense that we deal with a inode in the dead tree. This caused that the replace procedure was not dealing with free space cache entries anymore (which have btrfs_root_refs() == 0). I accidentally fixed it as a side-effect of "Bt

[PATCH] Btrfs: eliminate the exceptional root_tree refs=0

2013-09-05 Thread Stefan Behrens
he superblock and the log_roots below the log_root_tree still have btrfs_root_refs() == 0, only the tree_root is changed. Signed-off-by: Stefan Behrens --- fs/btrfs/disk-io.c | 1 + fs/btrfs/inode-map.c | 3 +-- fs/btrfs/inode.c | 21 - 3 files changed, 10 inse

Re: [PATCH] Btrfs: eliminate the exceptional root_tree refs=0

2013-09-06 Thread Stefan Behrens
On Fri, 06 Sep 2013 11:08:16 +0800, Miao Xie wrote: > Onthu, 5 Sep 2013 16:58:43 +0200, Stefan Behrens wrote: >> The fact that btrfs_root_refs() returned 0 for the tree_root caused >> bugs in the past, therefore it is set to 1 with this patch and >> (hopefully) all affect

Re: [PATCH] Btrfs: allocate the free space by the existed max extent size when ENOSPC

2013-09-06 Thread Stefan Behrens
On Fri, 30 Aug 2013 18:35:34 +0800, Miao Xie wrote: > By the current code, if the requested size is very large, and all the extents > in the free space cache are small, we will waste lots of the cpu time to cut > the requested size in half and search the cache again and again until it gets > down t

Re: [PATCH] Btrfs: allocate the free space by the existed max extent size when ENOSPC

2013-09-09 Thread Stefan Behrens
On 09/09/2013 08:21, Miao Xie wrote: On fri, 06 Sep 2013 15:47:08 +0200, Stefan Behrens wrote: On Fri, 30 Aug 2013 18:35:34 +0800, Miao Xie wrote: By the current code, if the requested size is very large, and all the extents in the free space cache are small, we will waste lots of the cpu time

[PATCH] Btrfs: add the missing mutex unlock in write_all_supers()

2013-09-11 Thread Stefan Behrens
/disk-io.c:3422:2-8: preceding lock on line 3374 Signed-off-by: Stefan Behrens --- This patch was also included in the v2 of "Btrfs: get rid of one BUG() in write_all_supers()", but the v1 made it into the repository, therefore this incremental send. fs/btrfs/disk-io.c | 1 + 1 file

Re: [PATCH 2/9] btrfs: use kernel workqueue to replace the btrfs_workers functions

2013-09-11 Thread Stefan Behrens
On Wed, 11 Sep 2013 16:52:31 +0800, Qu Wenruo wrote: > Use the kernel workqueue to replace the btrfs_workers which are only > used as normal workqueue. > > Other btrfs_workers will use some extra functions like requeue, high > priority and ordered work. > These btrfs_workers will not be touched in

[PATCH] xfstests: btrfs/011 improvement for compressed filesystems

2013-09-13 Thread Stefan Behrens
efore. Compression works now, online deduplication will again cause issues, but we don't have online deduplicatin today. Reported-by: Josef Bacik Signed-off-by: Stefan Behrens --- tests/btrfs/011 | 46 ++ 1 file changed, 30 insertions(+), 16 deletion

Re: [PATCH] Btrfs: create the uuid tree on remount rw

2013-09-21 Thread Stefan Behrens
On 09/21/2013 04:33, Josef Bacik wrote: Users have been complaining of the uuid tree stuff warning that there is no uuid root when trying to do snapshot operations. This is because if you mount -o ro we will not create the uuid tree. But then if you mount -o rw,remount we will still not create

Re: [PATCH] xfstests: btrfs/014: add a regression test for snapshot creation

2013-09-27 Thread Stefan Behrens
it a/tests/btrfs/014.out b/tests/btrfs/014.out > new file mode 100644 > index 000..db5250b > --- /dev/null > +++ b/tests/btrfs/014.out > @@ -0,0 +1,2 @@ > +QA output created by 014 > +Silence is golden > diff --git a/tests/btrfs/group b/tests/btrfs/group > index 8a16

Re: [PATCH] xfstests: btrfs/015 regression test for prealloc with balance

2013-09-27 Thread Stefan Behrens
t;> $seqres.full 2>&1 || \ > + _fail "pread failed" > + > +# This sucks but unfortunately it is the only way to be sure something > didn't go > +# wrong. > +_check_csum_error || _fail "csum detected, please check dmesg" > + > +echo "S

Re: [PATCH] btrfs: init device stats for new devices

2013-10-07 Thread Stefan Behrens
On Mon, 30 Sep 2013 14:58:02 -0700, Zach Brown wrote: >> I discovered one minor bug in BTRFS filesystem. > > You sure did. > >> ERROR: ioctl(BTRFS_IOC_GET_DEV_STATS) on /dev/sde failed: No such device >> >> But this is not true ... all specified devices exist and are members >> of btrfs filesyste

Re: minor wiki bug, check_int mount options description

2013-10-08 Thread Stefan Behrens
On Mon, 7 Oct 2013 13:07:25 -0600, Chris Murphy wrote: > I think the wiki has descriptions for check_int and check_int_data reversed: I've fixed it in the wiki. Thanks! -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majord...@vger.kernel.org

Re: [PATCH 02/12] btrfs-progs: check fopen failure in cmds-send

2013-10-08 Thread Stefan Behrens
On Mon, 7 Oct 2013 14:42:55 -0700, Zach Brown wrote: > Check for fopen() failure. This shows up in static analysis as a > possible null pointer derference. > > Signed-off-by: Zach Brown > --- > cmds-send.c | 5 + > 1 file changed, 5 insertions(+) > > diff --git a/cmds-send.c b/cmds-send.c

Re: [PATCH v4] btrfs: Fix memory leakage in the tree-log.c

2013-10-10 Thread Stefan Behrens
On Wed, 9 Oct 2013 23:01:35 -0300, Geyslan G. Bem wrote: > When 'dir' is NULL, after calling extref_get_fields(), add_inode_ref() > can be returning without freeing the 'name' pointer. > > Added kfree when necessary. > > Signed-off-by: Geyslan G. Bem > --- > fs/btrfs/tree-log.c | 5 - > 1

Re: [PATCH] Btrfs: disallow 'btrfs {balance,replace} cancel' on ro mounts

2013-10-11 Thread Stefan Behrens
It only adds errors to try to distuingish such things and is of no benefit for anybody IMHO. >> For both balance and replace, cancelling involves changing the on-disk >> state and committing a transaction, which is not a good thing to do on >> read-only filesystems. >> >

[PATCH] Btrfs: fail device statistic reset on read-only filesystem

2013-10-11 Thread Stefan Behrens
the 'btrfs device stat -z' failed to # clear the counters on disk, only the counters in main memory had been # cleared: btrfs device stat ${TEST_MNT} umount ${TEST_MNT} dmsetup remove foom; dmsetup remove foon Signed-off-by: Stefan Behrens --- fs/btrfs/volumes.c | 2 ++ 1 file changed, 2

Re: [PATCH v5] btrfs: Fix memory leakage in the tree-log.c

2013-10-11 Thread Stefan Behrens
On Thu, 10 Oct 2013 19:11:22 -0300, Geyslan G. Bem wrote: > In add_inode_ref() function: > > Initializes local pointers. > > Reduces the logical condition with the __add_inode_ref() return > value by using only one 'goto out'. > > Centralizes the exiting, ensuring the freeing of all used memory.

[PATCH] Btrfs: init device stats for new devices

2013-10-11 Thread Stefan Behrens
unc Signed-off-by: Stefan Behrens --- The idea to fix this issue, the subject line of the patch and parts of the commit log are reused from a patch that Zach Brown has sent. fs/btrfs/volumes.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 646d

Re: [PATCH] Btrfs: fail device statistic reset on read-only filesystem

2013-10-11 Thread Stefan Behrens
On Fri, 11 Oct 2013 09:47:33 -0400, Josef Bacik wrote: > Hey look something else that should go into xfstests, I don't think so. It's a bug that is there from the very beginning, not a regression. We can't catch all possible errors (non-regressions) with xfstests. We would spend all time for writi

[PATCH] Btrfs: Wait for uuid-tree rebuild task on remount read-only

2013-10-11 Thread Stefan Behrens
$TEST_MNT mount $TEST_DEV $TEST_MNT -o rescan_uuid_tree sleep 1 ps -elf | fgrep '[btrfs-uuid]' | grep -v grep mount $TEST_DEV $TEST_MNT -o ro,remount ps -elf | fgrep '[btrfs-uuid]' | grep -v grep sleep 1 umount $TEST_MNT Signed-off-by: Stefan Behrens --- fs/btrfs/super.c | 6 ++

Re: [PATCH v6] btrfs: Fix memory leakage in the tree-log.c

2013-10-11 Thread Stefan Behrens
ase_path(path); + kfree(name); iput(dir); iput(inode); return ret; The patch looks really good now. Thanks! Reviewed-by: Stefan Behrens -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majord...@

[PATCH] Btrfs: Don't allocate inode that is already in use

2013-10-15 Thread Stefan Behrens
ollowing loop: for i in `seq 3 9`; do touch ${TEST_MNT}/s3/__${i} || logger FAILED; done #for i in `seq 3 34027`; do touch ${TEST_MNT}/s3/__${i} || logger FAILED; done # one of the touch(1) calls in s3 fail due to EEXIST because the inode is # already in use that btrfs_find_ino_for_alloc() returns. S

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

2013-10-19 Thread Stefan Behrens
On 10/19/2013 06:17, Wang Shilong wrote: From: Wang Shilong Scrubing supers is not in a transaction context, when trying to write supers to disk, we should check if we are trying to scrub supers.Fix it. Signed-off-by: Wang Shilong --- fs/btrfs/disk-io.c | 2 ++ fs/btrfs/transaction.c |

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

2013-10-19 Thread Stefan Behrens
On 10/19/2013 12:32, Shilong Wang wrote: 2013/10/19, Stefan Behrens : On 10/19/2013 06:17, Wang Shilong wrote: From: Wang Shilong Scrubing supers is not in a transaction context, when trying to write supers to disk, we should check if we are trying to scrub supers.Fix it. Signed-off-by

[PATCH] Btrfs: fix check_int 'leaf item out of bounce' regression

2013-10-21 Thread Stefan Behrens
Yet another cleanup patch broke code for which no xfstest exists. 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 1c47be1..3281f7e 100644 --- a/fs/btrfs

[PATCH] Btrfs: check_int, remove warning for mixed-mode

2013-10-21 Thread Stefan Behrens
In mixed-mode, when a data-block was later reused for metadata, a warning was printed. This condition is now filtered out and the warning is eliminated in this case. Signed-off-by: Stefan Behrens --- fs/btrfs/check-integrity.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff

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

2013-10-22 Thread Stefan Behrens
On Sun, 20 Oct 2013 12:03:01 +0800, Wang Shilong wrote: >> On 10/19/2013 12:32, Shilong Wang wrote: >>> 2013/10/19, Stefan Behrens : >>>> On 10/19/2013 06:17, Wang Shilong wrote: >>>>> From: Wang Shilong >>>>> >>>>> Scr

Re: [PATCH v2] xfstests btrfs/020: test device replace on RO btrfs

2013-10-23 Thread Stefan Behrens
On Thu, 24 Oct 2013 00:44:43 +0800, Eryu Guan wrote: > btrfs replace on readonly fs should not be allowed. > > Regression test case for commit: > bbb651e Btrfs: don't allow the replace procedure on read only filesystems > > Signed-off-by: Eryu Guan > --- > v2: Address Eric's review > - use trun

<    1   2   3   4   5   6   >