3.19.3: fs/btrfs/super.c:260 __btrfs_abort_transaction+0x4c/0x10e [btrfs]()

2015-04-03 Thread Tomasz Chmielewski
Got this one for some reason; this fs did not have any issues before: [64343.060291] perf interrupt took too long (2544 > 2500), lowering kernel.perf_event_max_sample_rate to 5 [67344.630449] [ cut here ] [67344.630509] WARNING: CPU: 3 PID: 21885 at fs/btrfs/super.c

Btrfs ENOSPC issue

2015-04-03 Thread Justin Maggard
Hi, We're hitting a consistently reproducible ENOSPC condition with a simple test case: # truncate -s 1T btrfs.fs # mkfs.btrfs btrfs.fs # mount btrfs.fs /mnt/ # fallocate -l 1021G /mnt/fallocate # btrfs fi sync /mnt/ # dd if=/dev/zero of=/mnt/dd bs=1G # btrfs fi sync /mnt/ # rm /mnt/fallocate # b

Re: WARNING at fs/btrfs/super.c:260 __btrfs_abort_transaction (error -17)

2015-04-03 Thread Sophie Dexter
On 02/04/15 13:38, Sophie Dexter wrote: On 01/04/2015 15:13, Chris Mason wrote: On Tue, Mar 24, 2015 at 6:23 PM, Sophie wrote: On 24/03/15 17:34, Chris Mason wrote: On Tue, Mar 24, 2015 at 9:43 AM, Sophie Dexter wrote: On 20/03/2015 15:19, Sophie Dexter wrote: I'm given to understand t

Re: [PATCH] Btrfs: prevent deletion of mounted subvolumes

2015-04-03 Thread Omar Sandoval
On Thu, Apr 02, 2015 at 05:02:25PM +0200, David Sterba wrote: > On Wed, Apr 01, 2015 at 08:49:54PM -0700, Omar Sandoval wrote: > > Hm, yeah, that's unfortunate, thanks for pointing that out. It looks > > like we can get the subvolume ID reliably: > > > > > > diff --git a/fs/btrfs/super.c b/fs

Re: LPC2015: File and Storage Systems uconf

2015-04-03 Thread Chris Murphy
On Fri, Apr 3, 2015 at 12:28 PM, Darrick J. Wong wrote: > http://wiki.linuxplumbersconf.org/2015:file_and_storage_systems "userspace interactions with ongoing work in the filesystem and IO stack" I'm finding some weird [1] behaviors with Btrfs multiple device volumes in gnome-shell. The 2012 sta

mlocate/updatedb and btrfs subvolume mounts

2015-04-03 Thread G. Richard Bellamy
I've just noticed that I'm having issues with finding files using "locate" when those files are on btrfs subvolume mounts. The issue is that updatedb cannot discern the difference between a btrfs bind mount and btrfs subvolume [1][2]. This generally means that if you're using btrfs subvolume mount

[PATCH V2 linux-next] Btrfs: use BTRFS_COMPRESS_NONE instead of 0

2015-04-03 Thread Fabian Frederick
cow_file_range_inline() was called with 0 instead of actual definition. btrfs_finish_ordered_io() initialized compress_type with 0 as well. (Thanks to David Sterba for suggesting this update). Signed-off-by: Fabian Frederick --- V2: also replace 0 in btrfs_finish_ordered_io() fs/btrfs/inode.c

[PATCH v3] fstests: test for btrfs transaction abortion on device with discard support

2015-04-03 Thread Filipe Manana
Test that btrfs' transaction abortion does not corrupt a filesystem mounted with -o discard nor allows a subsequent fstrim to corrupt the filesystem (regardless of being mounted with or without -o discard). This issue was fixed by the following linux kernel patch: Btrfs: fix fs corruption on

LPC2015: File and Storage Systems uconf

2015-04-03 Thread Darrick J. Wong
Hi everyone, Linux Plumbers is coming up in just four months! I would like for there to be a file & storage miniconf at this year's LPC, so I've started assembling a plan for what we might discuss. As a starting point, I've filled the planning page with the topics that didn't achieve any sort of

[PATCH v2] fstests: test for btrfs transaction abortion on device with discard support

2015-04-03 Thread Filipe Manana
Test that btrfs' transaction abortion does not corrupt a filesystem mounted with -o discard nor allows a subsequent fstrim to corrupt the filesystem (regardless of being mounted with or without -o discard). This issue was fixed by the following linux kernel patch: Btrfs: fix fs corruption on

[PATCH 1/9] btrfs: fix condition of commit transaction

2015-04-03 Thread Zhaolei
From: Zhao Lei Old code bypass commit transaction when we don't have enough pinned space, but another case is there exist freed bgs in current transction, it have possibility to make alloc_chunk success. This patch modify the condition to: if (have_free_bg || have_pinned_space) commit_transactio

[PATCH 3/9] btrfs: Adjust commit-transaction condition to avoid NO_SPACE more

2015-04-03 Thread Zhaolei
From: Zhao Lei If we have any chance to make a successful write, we should not give up. This patch adjust commit-transaction condition from: pinned >= wanted to left + pinned >= wanted Signed-off-by: Zhao Lei --- fs/btrfs/extent-tree.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(

[PATCH 5/9] btrfs: add WARN_ON() to check is space_info op current

2015-04-03 Thread Zhaolei
From: Zhao Lei space_info's value calculation is some complex and easy to cause bug, add WARN_ON() to help debug. Changelog v1->v2: Put WARN_ON()s under the ENOSPC_DEBUG mount option. Suggested by: David Sterba Signed-off-by: Zhao Lei --- fs/btrfs/extent-tree.c | 10 ++ 1 file chan

[PATCH 7/9] btrfs: Support busy loop of write and delete

2015-04-03 Thread Zhaolei
From: Zhao Lei Reproduce: while true; do dd if=/dev/zero of=/mnt/btrfs/file count=[75% fs_size] rm /mnt/btrfs/file done Then we can see above loop failed on NO_SPACE. It it long-term problem since very beginning, because delayed-iput after rm are not run. We already have commit_transac

[PATCH 4/9] btrfs: Set relative data on clear btrfs_block_group_cache->pinned

2015-04-03 Thread Zhaolei
From: Zhao Lei Bug1: space_info->bytes_readonly was set to very large(negative) value in btrfs_remove_block_group(). Reason: Current code set block_group_cache->pinned = 0 in btrfs_delete_unused_bgs(), but above space was not counted to space_info->bytes_readonly. Then in btrfs_remove

[PATCH 9/9] btrfs: cleanup unused alloc_chunk varible

2015-04-03 Thread Zhaolei
From: Zhao Lei Remove int alloc_chunk in btrfs_check_data_free_space() for not necessary. Signed-off-by: Zhao Lei --- fs/btrfs/extent-tree.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index 05747d2..b83060f 100644 ---

[PATCH 8/9] btrfs: wait for delayed iputs on no space

2015-04-03 Thread Zhaolei
From: Zhao Lei btrfs will report no_space when we run following write and delete file loop: # FILE_SIZE_M=[ 75% of fs space ] # DEV=[ some dev ] # MNT=[ some dir ] # # mkfs.btrfs -f "$DEV" # mount -o nodatacow "$DEV" "$MNT" # for ((i = 0; i < 100; i++)); do dd if=/dev/zero of="$MNT"/file0

[PATCH 2/9] btrfs: Fix tail space processing in find_free_dev_extent()

2015-04-03 Thread Zhaolei
From: Zhao Lei It is another reason for NO_SPACE case. When we found enough free space in loop and saved them to max_hole_start/size before, and tail space contains pending extent, origional innocent max_hole_start/size are reset in retry. As a result, find_free_dev_extent() returns less space

[PATCH 6/9] btrfs: Fix NO_SPACE bug caused by delayed-iput

2015-04-03 Thread Zhaolei
From: Zhao Lei Steps to reproduce: while true; do dd if=/dev/zero of=/btrfs_dir/file count=[fs_size * 75%] rm /btrfs_dir/file sync done And we'll see dd failed because btrfs return NO_SPACE. Reason: Normally, btrfs_commit_transaction() call btrfs_run_delayed_iputs() in end

[PATCH 0/9] btrfs: Fix no_space on dd and rm loop

2015-04-03 Thread Zhaolei
From: Zhao Lei I resend this patch set with some changes: 1: Move a cleanup patch for btrfs_check_data_free_space() into 2: Rebased on top of v4.0-rc5 3: Fixed a lock problem reported by: 'Tsutomu Itoh' Tested by busy dd and rm loop script in 2000 times. Confirmed having-problem in v4.0-rc5

Re: [PATCH v3] btrfs-progs: Doc: Add warning and note on btrfs-convert.

2015-04-03 Thread Duncan
Roman Mamedov posted on Fri, 03 Apr 2015 12:16:56 +0500 as excerpted: > On Fri, 3 Apr 2015 15:06:46 +0800 Qu Wenruo > wrote: > >> >> +WARNING: If one hopes to rollback to ext2/3/4, he or she should not >> >> execute > > It also seems a bit awkward to spell out "he or she", if you want to > refe

Re: [PATCH v3] btrfs-progs: Doc: Add warning and note on btrfs-convert.

2015-04-03 Thread Duncan
Qu Wenruo posted on Fri, 03 Apr 2015 15:06:46 +0800 as excerpted: > It seems my English is really poor... :( I think the usual response is "Better than my Chinese!" =:^) Seriously, tho, it's better than many native English speakers/writers as well, good enough I'd not guess different were it no

[PATCH v4] btrfs-progs: Doc: Add warning and note on btrfs-convert.

2015-04-03 Thread Qu Wenruo
Although btrfs-convert can rollback converted btrfs, it still has some limitation to ensure rollback. Add a warning on the limitations. Also add a note for users who decides to go on with btrfs and don't need the rollback ability. Reported-by: Vytautas D Reported-by: Tsutomu Itoh Signed-off-by

Re: [PATCH v3] btrfs-progs: Doc: Add warning and note on btrfs-convert.

2015-04-03 Thread Roman Mamedov
On Fri, 3 Apr 2015 15:06:46 +0800 Qu Wenruo wrote: > >> +WARNING: If one hopes to rollback to ext2/3/4, he or she should not > >> execute It also seems a bit awkward to spell out "he or she", if you want to refer to a user without specifying the gender, in software documentation it's more commo

Re: [PATCH v3] btrfs-progs: Doc: Add warning and note on btrfs-convert.

2015-04-03 Thread Qu Wenruo
Qu Wenruo posted on Fri, 03 Apr 2015 09:21:15 +0800 as excerpted: +WARNING: If one hopes to rollback to ext2/3/4, he or she should not execute +*btrfs balance* command on converted btrfs. +Since it will change the extent layout and make *btrfs-convert* unable to +rollback. Because "since" is s

[PATCH 2/6] btrfs-progs: fsck-tests: Remove duplicatesd TEST_MNT setup.

2015-04-03 Thread Qu Wenruo
Since we have already had TEST_MNT fallback setup to $TOP/tests/mnt, just remove duplicated setting in 012-leaf-corruption/test.sh Signed-off-by: Qu Wenruo --- tests/fsck-tests/012-leaf-corruption/test.sh | 4 1 file changed, 4 deletions(-) diff --git a/tests/fsck-tests/012-leaf-corruption

[PATCH 5/6] btrfs-progs: convert-tests: Update to use test framework infrastructure.

2015-04-03 Thread Qu Wenruo
Also change the test() to convert_test(), to avoid conflict name with bash test function. Signed-off-by: Qu Wenruo --- tests/convert-tests.sh | 68 -- 1 file changed, 33 insertions(+), 35 deletions(-) diff --git a/tests/convert-tests.sh b/tests/co

[PATCH 6/6] btrfs-progs: convert-tests: Add check for converted btrfs with regular file extent.

2015-04-03 Thread Qu Wenruo
Regression test for previous patch "btrfs-progs: convert: Make ext*_image file obey datacsum setting." Signed-off-by: Qu Wenruo --- tests/convert-tests.sh | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tests/convert-tests.sh b/tests/convert-tests.sh index 7652a6c..

[PATCH 4/6] btrfs-progs: fsck-tests: Add fallback TEST_DEV for test case 013

2015-04-03 Thread Qu Wenruo
Add fallback TEST_DEV for test case 013. Fallback to $TOP/tests/test.img. Now all test cases of btrfs-progs need no extra setting except sudo. Signed-off-by: Qu Wenruo --- tests/fsck-tests/013-extent-tree-rebuild/test.sh | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git

[PATCH 1/6] btrfs-progs: test-frame: Update variant names

2015-04-03 Thread Qu Wenruo
Use upper case variant name for the following variants: 1) top -> TOP 2) script_dir -> SCRIPT_DIR And change the following variant name: 1) RESULT -> RESULTS Signed-off-by: Qu Wenruo --- tests/common | 20 ++-- tests/fsck-tests.sh

[PATCH 3/6] btrfs-progs: fsck-tests: Update 013-extent-tree-rebuild to use more test framework infrastructure.

2015-04-03 Thread Qu Wenruo
Update 013-extent-tree-rebuild to use more framework infrastructure, including: 1) Use run_check other than open-coded redirect 2) Add root privillege 3) Add dependency on 'btrfs-debug-tree' command Signed-off-by: Qu Wenruo --- tests/fsck-tests/013-extent-tree-rebuild/test.sh | 25 +-

[PATCH 0/6] New test case for btrfs-convert and serval minor updates on framework/test cases

2015-04-03 Thread Qu Wenruo
The patchset do the following things: 1) Test framework variant naming update Change some lower case variant name to upper case. Provides a unified naming scheme. 2) Remove duplicated TEST_MNT check Fsck test case 012 has duplicated TEST_MNT, just remove it. 3) Update test cases to use m