[PATCH] btrfs-progs: Check the csum tree node before go through the csum tree

2014-09-30 Thread Qu Wenruo
[BUG] Some fsfuzzed btrfs image will cause btrfsck segfault. [REPRODUCER] Run btrfsck on a csum tree block corrupted image. [REASON] check_csums() function call btrfs_search_slot() on csum_tree but doesn't check whether the csum_tree contains a valid extent_buffer, which causes the segfault.

Re: [PATCH] Btrfs-progs: make BUG*() be more verbose

2014-09-30 Thread David Sterba
On Thu, Sep 25, 2014 at 04:07:10PM -0400, Josef Bacik wrote: Currently these macros just tie to assert(), which gives us line number and such but no backtrace so no actual context. This patch adds support for spitting out a backtrace so we can see how we got to the given assert. Thanks,

Re: [PATCH] btrfs-progs: Don't return any fs_info that contain NULL tree_root or fs_root.

2014-09-30 Thread David Sterba
On Tue, Sep 30, 2014 at 10:39:22AM +0800, Qu Wenruo wrote: --- a/disk-io.c +++ b/disk-io.c @@ -1134,7 +1134,8 @@ static struct btrfs_fs_info *__open_ctree_fd(int fp, const char *path, return fs_info; out_failed: - if (flags OPEN_CTREE_PARTIAL) + if (flags

Re: [PATCH RFC] btrfs: introduce procfs interface for the device list

2014-09-30 Thread Chris Mason
On Mon, Sep 29, 2014 at 1:09 AM, Anand Jain anand.j...@oracle.com wrote: From: Anand Jain anand.j...@oracle.com (added RFC prefix to the patch header) (as of now just an experimental interface) This patch introduces profs interface /proc/fs/btrfs/devlist, which as of now exports all the

Re: btrfs-progs: initial reference count of extent buffer is correct?

2014-09-30 Thread naota
Hi, Liu Thank you for your explanation, and I'm sorry for this long silence. Liu Bo bo.li@oracle.com writes: You may think of it twice, commit 53ee1bccf99cd5b474fe1aa857b7dd176e3a1407 is to fix a bug of assigning a free block to two different extent buffers, ie. two different extent

[PATCH] btrfs-progs: do not reclaim extent buffer

2014-09-30 Thread Naohiro Aota
We should kill free_some_buffers() to stop reclaiming extent buffers or we will hit a problem described below. As of commit 53ee1bccf99cd5b474fe1aa857b7dd176e3a1407, we are not counting a reference for tree-lru anymore. However free_some_buffers() is still left and is reclaiming extent buffers

Re: [PATCH] btrfs-progs: Don't return any fs_info that contain NULL tree_root or fs_root.

2014-09-30 Thread Zach Brown
btrfs_setup_all_roots(). Please test if it fixes the crash with the corrupted image you have. Thanks. Perhaps with a test in xfstests. - z -- 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

Re: [PATCH v4 01/15] btrfs: new test to run btrfs balance and subvolume test simultaneously

2014-09-30 Thread Eryu Guan
On Mon, Sep 29, 2014 at 03:03:48PM -0400, Josef Bacik wrote: On 09/26/2014 12:14 AM, Eryu Guan wrote: Run btrfs balance and subvolume create/mount/umount/delete simultaneously, with fsstress running in background. Signed-off-by: Eryu Guan eg...@redhat.com --- [snip] +

Re: [PATCH v4 01/15] btrfs: new test to run btrfs balance and subvolume test simultaneously

2014-09-30 Thread Josef Bacik
On 09/30/2014 11:48 AM, Eryu Guan wrote: On Mon, Sep 29, 2014 at 03:03:48PM -0400, Josef Bacik wrote: On 09/26/2014 12:14 AM, Eryu Guan wrote: Run btrfs balance and subvolume create/mount/umount/delete simultaneously, with fsstress running in background. Signed-off-by: Eryu Guan

Re: [PATCH v4 01/15] btrfs: new test to run btrfs balance and subvolume test simultaneously

2014-09-30 Thread Eryu Guan
On Tue, Sep 30, 2014 at 11:54:30AM -0400, Josef Bacik wrote: On 09/30/2014 11:48 AM, Eryu Guan wrote: On Mon, Sep 29, 2014 at 03:03:48PM -0400, Josef Bacik wrote: On 09/26/2014 12:14 AM, Eryu Guan wrote: Run btrfs balance and subvolume create/mount/umount/delete simultaneously, with fsstress

Re: [PATCH v4 01/15] btrfs: new test to run btrfs balance and subvolume test simultaneously

2014-09-30 Thread Josef Bacik
On 09/30/2014 12:08 PM, Eryu Guan wrote: On Tue, Sep 30, 2014 at 11:54:30AM -0400, Josef Bacik wrote: On 09/30/2014 11:48 AM, Eryu Guan wrote: On Mon, Sep 29, 2014 at 03:03:48PM -0400, Josef Bacik wrote: On 09/26/2014 12:14 AM, Eryu Guan wrote: Run btrfs balance and subvolume

[PATCH] btrfs: add more superblock checks

2014-09-30 Thread David Sterba
Populate btrfs_check_super_valid() with checks that try to verify consistency of superblock by additional conditions that may arise from corrupted devices or bitflips. Some of tests are only hints and issue warnings instead of failing the mount, basically when the checks are derived from the data

Re: 3.16.3 btrfs receive dies with rename o4736059-335172-0 - merlin/RC/OSD failed. Directory not empty machine

2014-09-30 Thread Elliot Wolk
Marc MERLIN marc at merlins.org writes: Hi Filipe and others, After I moved directories around, and since then my hourly btrfs backup is failing. ... ERROR: rename o4736059-335172-0 - merlin/RC/OSD failed. Directory not empty i have the exact same problem, also 3.16-3. i did

[PATCH] Btrfs-progs: check all slots in leaves

2014-09-30 Thread Josef Bacik
There's an off by one error in btrfs_check_leaf, we should be going to nritems - 1, not nritems - 2, we were missing problems with items in the very last slot. Thanks, Signed-off-by: Josef Bacik jba...@fb.com --- ctree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ctree.c

[PATCH] Btrfs-progs: add shift_items to btrfs-corrupt-block

2014-09-30 Thread Josef Bacik
A user had a corrupted fs where his items where shifted oddly. This adds the functionality I needed to btrfs-corrupt-block in order to reproduce this corruption in order to make fsck fix this sort of problem. Thanks, Signed-off-by: Josef Bacik jba...@fb.com --- btrfs-corrupt-block.c | 26

[PATCH] Btrfs-progs: add the ability to fix shifted item offsets

2014-09-30 Thread Josef Bacik
A user had a corrupted fs where the items had been shifted improperly. This patch adds the ability to fix this sort of problem within fsck. We will simply shift the item over to the proper offset and update the offsets to make sure they are correct. I tested this with a hand crafted fs that was

[PATCH v2 3/3] btrfs: fix sparse lock context warnings

2014-09-30 Thread Omar Sandoval
Fix several sparse warnings that can easily be addressed with context annotations. These annotations also provide some sort of documentation for the internal helper functions. Signed-off-by: Omar Sandoval osan...@osandov.com Reviewed-by: David Sterba dste...@suse.cz --- fs/btrfs/extent-tree.c

[PATCH v2 1/3] btrfs: replace open-coded kernel_write

2014-09-30 Thread Omar Sandoval
write_buf used by btrfs send has what is more or less a reimplementation of kernel_write. This also gets rid of a sparse address space warning. Signed-off-by: Omar Sandoval osan...@osandov.com --- fs/btrfs/send.c | 21 ++--- 1 file changed, 6 insertions(+), 15 deletions(-) diff

[PATCH v2 0/3] btrfs: fix several sparse warnings

2014-09-30 Thread Omar Sandoval
This patch series fixes some warnings reported by sparse when building the btrfs module. It fixes two classes of warnings: address space warnings and lock context warnings. This didn't uncover any logical errors, but it reduces the noise when checking the source. There are a few less

Re: [PATCH v2 1/3] btrfs: replace open-coded kernel_write

2014-09-30 Thread Zach Brown
On Tue, Sep 30, 2014 at 03:01:40PM -0700, Omar Sandoval wrote: write_buf used by btrfs send has what is more or less a reimplementation of kernel_write. This also gets rid of a sparse address space warning. Seems reasonable to me: Reviewed-by: Zach Brown z...@zabbo.net - z -- To unsubscribe