Re: kernel BUG at fs/btrfs/extent-tree.c:8113! (4.1.3 kernel)

2015-08-24 Thread Marc MERLIN
On Tue, Aug 25, 2015 at 02:00:32PM +0800, Qu Wenruo wrote: > Thanks for all your work and patient Marc, Haha, no problem, you're doing a lot more work than I am :) > Good to know there is backup. > But as there is no higher generation one, so I'd assume that's not a > normal transaction id failu

[PATCH] btrfs-progs: add missing free operation of raid_map for raid56

2015-08-24 Thread Zhao Lei
We forgot free raid_map for raid56's map_bio. This patch add it. Signed-off-by: Zhao Lei --- disk-io.c | 1 + 1 file changed, 1 insertion(+) diff --git a/disk-io.c b/disk-io.c index fdcfd6d..46a5a46 100644 --- a/disk-io.c +++ b/disk-io.c @@ -428,6 +428,7 @@ int write_and_map_eb(struct btrfs_tra

Re: kernel BUG at fs/btrfs/extent-tree.c:8113! (4.1.3 kernel)

2015-08-24 Thread Qu Wenruo
Marc MERLIN wrote on 2015/08/24 22:28 -0700: On Tue, Aug 25, 2015 at 10:51:00AM +0800, Qu Wenruo wrote: Patches sent and CCed to you. Please try the two patches and see what's new. This time, I think the output will be much larger. Indeed. However the bad news is that gen 39538 is the high

Re: kernel BUG at fs/btrfs/extent-tree.c:8113! (4.1.3 kernel)

2015-08-24 Thread Marc MERLIN
On Tue, Aug 25, 2015 at 10:51:00AM +0800, Qu Wenruo wrote: > Patches sent and CCed to you. > > Please try the two patches and see what's new. > This time, I think the output will be much larger. Indeed. However the bad news is that gen 39538 is the highest. Should I force btrfsck to work with an

[PATCH v8 3/3] xfstests: btrfs: test device delete with EIO on src dev

2015-08-24 Thread Anand Jain
From: Anand Jain This test case tests if the device delete works with the failed (EIO) source device. EIO errors are achieved usign the DM device. This test would need following btrfs-progs and btrfs kernel patch btrfs-progs: device delete to accept devid Btrfs: device delete by devid How

[PATCH v8 2/3] xfstests: btrfs: test device replace, with EIO on the src dev

2015-08-24 Thread Anand Jain
From: Anand Jain This test case will test to confirm the replace works with the failed (EIO) replacing source device. EIO condition is achieved using the DM device. Signed-off-by: Anand Jain Reviewed-by: Filipe Manana --- v7->v8: . Inline with the patch 1/3 v8 changes, use dmerror_mount() v6

[PATCH v8 1/3] xfstests: btrfs: add functions to create dm-error device

2015-08-24 Thread Anand Jain
From: Anand Jain Controlled EIO from the device is achieved using the dm device. Helper functions are at common/dmerror. Broadly steps will include calling _dmerror_init(). _dmerror_init() will use SCRATCH_DEV to create dm linear device and assign DMERROR_DEV to /dev/mapper/error-test. When tes

Re: [PATCH v6 1/3] xfstests: btrfs: add functions to create dm-error device

2015-08-24 Thread Anand Jain
Dave, On 08/21/2015 05:45 AM, Dave Chinner wrote: On Thu, Aug 20, 2015 at 03:09:05PM +0800, Anand Jain wrote: (thanks for the off-ML emails from the people who helped me to understand). Dave, looks like you are suggesting something like.. --- +_dmerror_mount_options() +{ +

[PATCH v8 0/3] dm error based test cases

2015-08-24 Thread Anand Jain
The patch 1/3 provides a framework to use dmerror device to test volume manager operations. Patch 2/3 adds a test case to test replacing a dmerror device Patch 3/3 adds a test case to test deleting a dmerror device This is v8 of this patch set. In this version it mainly accepts Dave's latest revie

Re: kernel BUG at fs/btrfs/extent-tree.c:8113! (4.1.3 kernel)

2015-08-24 Thread Qu Wenruo
Marc MERLIN wrote on 2015/08/24 07:10 -0700: On Mon, Aug 24, 2015 at 01:11:26PM +0800, Qu Wenruo wrote: So, my last bet will be, using "btrfs-find-root -a" to find the root with highest generation, and use the new root to exec "btrfsck -b ". The latest btrfs-find-root would output possible

[PATCH 1/2] btrfs-progs: find-root: Output matched root when searching all roots

2015-08-24 Thread Qu Wenruo
[Bug] When given '-a' option, btrfs-find-root will output all possible tree roots but the exact matched one. [Reason] Result printing skipes the exact match one, as it will normally be shown before the alternative ones. But when '-a' is given, that's not the case. [Fix] Just show the exact match

[PATCH 2/2] btrfs-progs: find-root: Fix a bug that will cause wrong result

2015-08-24 Thread Qu Wenruo
[BUG] btrfs-find-root may not output desire result, as due to search_extent_cache() may return result which doesn't cover the desired range, generation cache can be screwed up if higher generation tree root is found before lower generation tree root. For example: === ./btrfs-find-root /dev/sd

Re: kernel BUG at fs/btrfs/extent-tree.c:8113! (4.1.3 kernel)

2015-08-24 Thread Qu Wenruo
Marc MERLIN wrote on 2015/08/24 07:10 -0700: On Mon, Aug 24, 2015 at 01:11:26PM +0800, Qu Wenruo wrote: So, my last bet will be, using "btrfs-find-root -a" to find the root with highest generation, and use the new root to exec "btrfsck -b ". The latest btrfs-find-root would output possible

[PATCH] btrfs: Fixed declaration of old_len

2015-08-24 Thread Alexandru Moise
old_len is used to store the return value of btrfs_item_size_nr(). The return value of btrfs_item_size_nr() is of type u32. To improve code correctness and avoid mixing signed and unsigned integers I've changed old_len to be of type u32 as well. Signed-off-by: Alexandru Moise <00moses.alexande...@

[PATCH 5/5] btrfs: Remove len argument from scrub_find_csum

2015-08-24 Thread Zhao Lei
It is useless. Signed-off-by: Zhao Lei --- fs/btrfs/scrub.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c index bdf44c9..daf75ac 100644 --- a/fs/btrfs/scrub.c +++ b/fs/btrfs/scrub.c @@ -2459,8 +2459,7 @@ static void scrub_block_com

[PATCH 4/5] btrfs: Reduce unnecessary arguments in scrub_recheck_block

2015-08-24 Thread Zhao Lei
We don't need pass so many arguments for recheck sblock now, this patch cleans them. Signed-off-by: Zhao Lei --- fs/btrfs/scrub.c | 28 1 file changed, 8 insertions(+), 20 deletions(-) diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c index 05dab4a..bdf44c9 100644 --

[PATCH 1/5] btrfs: scrub: setup all fields for sblock_to_check

2015-08-24 Thread Zhao Lei
scrub_setup_recheck_block() isn't setup all necessary fields for sblock_to_check because history reason. So current code need more arguments in severial functions, and more local variables, just to passing these lacked values to necessary place. This patch setup above fields to sblock_to_check in

[PATCH 3/5] btrfs: Use scrub_checksum_data and scrub_checksum_tree_block for scrub_recheck_block_checksum

2015-08-24 Thread Zhao Lei
We can use existing scrub_checksum_data() and scrub_checksum_tree_block() for scrub_recheck_block_checksum(), instead of write duplicated code. It is base on patch of: setup all fields for sblock_to_check which make this merge possible. Signed-off-by: Zhao Lei --- fs/btrfs/scrub.c | 126 +

[PATCH 2/5] btrfs: Reset sblock->xxx_error stats before calling scrub_recheck_block_checksum

2015-08-24 Thread Zhao Lei
We should reset sblock->xxx_error stats before calling scrub_recheck_block_checksum(). Current code run correctly because all sblock are allocated by k[cz]alloc(), and the error stats are not got changed. Signed-off-by: Zhao Lei --- fs/btrfs/scrub.c | 4 1 file changed, 4 insertions(+) di

[PATCH 0/5] btrfs: scrub: setup all fields for sblock_to_check

2015-08-24 Thread Zhao Lei
scrub_setup_recheck_block() isn't setup all necessary fields for sblock_to_check because history reason. So current code need more arguments in severial functions, and more local variables, just to passing these lacked values to necessary place. [PATCH 1/5] setup above fields for sblock_to_check,

Re: kernel BUG at fs/btrfs/extent-tree.c:8113! (4.1.3 kernel)

2015-08-24 Thread Marc MERLIN
On Mon, Aug 24, 2015 at 01:11:26PM +0800, Qu Wenruo wrote: > So, my last bet will be, using "btrfs-find-root -a" to find the root > with highest generation, and use the new root to exec "btrfsck -b > ". > The latest btrfs-find-root would output possible tree root by > descending order of its gene

Re: Kernel 4.1.4 btrfs forced read-only during rsync

2015-08-24 Thread E V
FYI, unmounted the filesystem and it checked clean: # btrfs check /dev/sdd Checking filesystem on /dev/sdd UUID: 550c0f77-8f75-40f3-a64e-42c87a0c8e8d checking extents checking free space cache checking fs roots checking csums checking root refs found 116808409085477 bytes used err is 0 total csum b

Re: [RFC 4/8] jbd, jbd2: Do not fail journal because of frozen_buffer allocation failure

2015-08-24 Thread Michal Hocko
Hi Ted, On Sat 15-08-15 09:54:22, Theodore Ts'o wrote: > On Wed, Aug 12, 2015 at 11:14:11AM +0200, Michal Hocko wrote: > > > Is this "if (!committed_data) {" check now dead code? > > > > > > I also see other similar suspected dead sites in the rest of the series. > > > > You are absolutely right

[PATCH] Btrfs: Direct I/O: Fix space accounting

2015-08-24 Thread Chandan Rajendra
The following call trace is seen when generic/095 test is executed, WARNING: CPU: 3 PID: 2769 at /home/chandan/code/repos/linux/fs/btrfs/inode.c:8967 btrfs_destroy_inode+0x284/0x2a0() Modules linked in: CPU: 3 PID: 2769 Comm: umount Not tainted 4.2.0-rc5+ #31 Hardware name: QEMU Standard PC (i44

Trying to balance/delete after drive failure

2015-08-24 Thread jan
Hi Guys, I am running a raid1 btrfs with 4 disks. One of my disks died the other day. So I replaced it with a new one. After that I tried to delete the failed (now missing) disk. This resulted in some but not much IO and some messages like these: kernel: BTRFS info (device sdd): found 9 extent

[PATCH 1/2] btrfs-progs: Introduce btrfs_close_all_devices to close all fs_devices in fs_uuids list

2015-08-24 Thread Zhao Lei
If more than one fs_devices in fs_uuids list(as mkfs.btrfs), we need close them all before exit. This function is for above propose. Signed-off-by: Zhao Lei --- volumes.c | 11 +++ volumes.h | 1 + 2 files changed, 12 insertions(+) diff --git a/volumes.c b/volumes.c index f7462c5..ca50

[PATCH 2/2] btrfs-progs: close all fs_devices before exit in some commands

2015-08-24 Thread Zhao Lei
mkfs created more than one fs_devices in fs_uuids. 1: one is for file system been created 2: others are created in test_dev_for_mkfs for check mount point test_dev_for_mkfs()-> ... -> btrfs_scan_one_device() Current code only close above 1, and this patch close above 2. Similar problem exist i

Re: Newbie: RAID5 available space

2015-08-24 Thread Duncan
Ivan posted on Mon, 24 Aug 2015 11:52:08 +0800 as excerpted: > I'm trying out RAID5 to understand its space usage. First off, I've 3 > devices of 2GB each, in RAID5. Old school RAID5 tells me I've 4GB of > usable space. Actual fact: I've about 3.5GB, until it tells me I'm out > of space. This is u