[PATCH] btrfs: progs: Unmount TEST_DEV before mount again

2015-08-27 Thread Zhao Lei
If a testcase failed, we can't run it(or other tests needs mount) again, # ./misc-tests.sh 007 [TEST] 007-subvolume-sync failed: fail test failed for case 007-subvolume-sync # ./misc-tests.sh 007 [TEST] 007-subvolume-sync failed: mount /root/btrfs-progs/tests/test.img /root/btr

[PATCH] btrfs-progs: tests: Add testcase filter for misc-tests

2015-08-27 Thread Zhao Lei
Add testcase filter for misc-tests, so we can select to run necessary test cases. For example: # ./misc-tests.sh 002 [TEST] 002-uuid-rewrite # # ./misc-tests.sh subvolume [TEST] 007-subvolume-sync # Signed-off-by: Zhao Lei --- tests/misc-tests.sh | 4 +++- 1 file changed, 3 inse

[PATCH] btrfs-progs: tests: Introduce subvolume sync test

2015-08-27 Thread Zhao Lei
Current code have following bug for subvolume sync: 1: If there are more than 1 subvolume to sync, the program will infinitely loop. 2: return !0 in exit This patch add misc-tests/007-subvolume-sync for above case. Signed-off-by: Zhao Lei --- tests/misc-tests/007-subvolume-sync/test.sh | 32

Re: [PATCH-RFC-RESEND 1/9] vfs: pull btrfs clone API to vfs layer

2015-08-27 Thread Peng Tao
On Wed, Aug 26, 2015 at 9:37 PM, David Sterba wrote: > On Wed, Aug 26, 2015 at 04:16:42PM +0800, Peng Tao wrote: >> +struct file_clone_range { >> + __s64 src_fd; >> + __u64 src_offset; >> + __u64 src_length; >> + __u64 dest_offset; >> +}; > > Might be a good idea to add some spare

Re: [PATCH] Btrfs: deal with error on secondary log properly

2015-08-27 Thread Liu Bo
On Tue, Aug 25, 2015 at 01:09:43PM -0400, Josef Bacik wrote: > If we have an fsync at the same time in two seperate subvolumes we could end > up > with the tree log pointing at invalid blocks. We need to notice if our > writeout > failed in anyway, if it did then we need to do a full transaction

Re: [PATCH 0/3] introduce function to handle device offline

2015-08-27 Thread Anand Jain
Just a reminder. Any comments ? Thanks Anand On 04/08/2015 22:43, Anand Jain wrote: Here the patch 3/3 below adds a function to handle device offline, also in this patch the device offline is triggred by the external sysfs interface. Patch 1/3 makes it possible to mount a or continue to be

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

2015-08-27 Thread Liu Bo
On Thu, Aug 27, 2015 at 11:39:00PM +0530, Chandan Rajendra wrote: > 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: 2

[PATCH] fstests: template: Add seqres.full cleanup

2015-08-27 Thread Qu Wenruo
Add cleanup for seqres.full for new test case template, as sometimes new testcase may forgot to cleanup seqres.full. Signed-off-by: Qu Wenruo --- new | 3 +++ 1 file changed, 3 insertions(+) diff --git a/new b/new index c734bdc..ab2af69 100755 --- a/new +++ b/new @@ -200,6 +200,9 @@ _cleanup()

Re: Btrfs crash since 4.1.4

2015-08-27 Thread Chris Murphy
On Thu, Aug 27, 2015 at 4:03 PM, Yasuo Ohgaki wrote: > Hi developers, > > I'm start getting kernel crash/oops from btrfs since 4.1.4. > https://www.kernel.org/pub/linux/kernel/v4.x/ChangeLog-4.1.4 > > I'm using fedora 22, so I reported this to their bugzilla. > https://bugzilla.redhat.com/show_bug

Btrfs crash since 4.1.4

2015-08-27 Thread Yasuo Ohgaki
Hi developers, I'm start getting kernel crash/oops from btrfs since 4.1.4. https://www.kernel.org/pub/linux/kernel/v4.x/ChangeLog-4.1.4 I'm using fedora 22, so I reported this to their bugzilla. https://bugzilla.redhat.com/show_bug.cgi?id=1255509 If you need additional information to fix issue,

[PATCH] btrfs: trimming some start_transaction() code away

2015-08-27 Thread Alexandru Moise
Just call kmem_cache_zalloc() instead of calling kmem_cache_alloc(). We're just initializing most fields to 0, false and NULL later on _anyway_, so to make the code mode readable and potentially gain a bit of performance (completely untested claim), we should fill our btrfs_trans_handle with zeros

Re: Impossible to mount two different copies of the same btrfs

2015-08-27 Thread Hugo Mills
On Thu, Aug 27, 2015 at 08:44:15PM +0200, carlo von lynX wrote: > Thanks for the feedback. I thought I had bumped into a totally excentric > use case but really I am making a most average beginner's mistake. I > should have noticed when my thinking was in terms of rsync. btrfs-tune > would be the h

Re: Impossible to mount two different copies of the same btrfs

2015-08-27 Thread carlo von lynX
Thanks for the feedback. I thought I had bumped into a totally excentric use case but really I am making a most average beginner's mistake. I should have noticed when my thinking was in terms of rsync. btrfs-tune would be the hack I first thought of, but I realize that is the wimp's way to go. So

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

2015-08-27 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

Re: Impossible to mount two different copies of the same btrfs

2015-08-27 Thread Hugo Mills
On Thu, Aug 27, 2015 at 11:53:28AM -0600, Chris Murphy wrote: > On Thu, Aug 27, 2015 at 11:32 AM, carlo von lynX > wrote: > > Hi there. Excuse me if I didn't subscribe the list. Just wanted to > > let you know of this behavior assuming you haven't noticed it yet. > > > > When mounting two copies o

Re: Impossible to mount two different copies of the same btrfs

2015-08-27 Thread Hugo Mills
On Thu, Aug 27, 2015 at 07:32:29PM +0200, carlo von lynX wrote: > Hi there. Excuse me if I didn't subscribe the list. Just wanted to > let you know of this behavior assuming you haven't noticed it yet. Thanks for the thought. :) > When mounting two copies of the same file system from two diffe

Re: Impossible to mount two different copies of the same btrfs

2015-08-27 Thread Chris Murphy
On Thu, Aug 27, 2015 at 11:32 AM, carlo von lynX wrote: > Hi there. Excuse me if I didn't subscribe the list. Just wanted to > let you know of this behavior assuming you haven't noticed it yet. > > When mounting two copies of the same file system from two different > hard disks with the intention

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

2015-08-27 Thread Chandan Rajendra
On Thursday 27 Aug 2015 19:09:44 Liu Bo wrote: > On Mon, Aug 24, 2015 at 05:34:17PM +0530, Chandan Rajendra wrote: > > 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

Re: Meta data full on a Readynas

2015-08-27 Thread Chris Murphy
On Thu, Aug 27, 2015 at 11:41 AM, Chris Murphy wrote: > On Thu, Aug 27, 2015 at 11:33 AM, Mike Aubury wrote: >> # btrfs dev scan >> Scanning for Btrfs filesystems >> >> (back to # prompt) >> >> >> # mount -o ro,degraded /data >> >> >> Seems to work, /data is mounted >> >> # btrfs fi show >> Labe

Impossible to mount two different copies of the same btrfs

2015-08-27 Thread carlo von lynX
Hi there. Excuse me if I didn't subscribe the list. Just wanted to let you know of this behavior assuming you haven't noticed it yet. When mounting two copies of the same file system from two different hard disks with the intention of syncing the older with the newer one, btrfs behaves differently

Re: Meta data full on a Readynas

2015-08-27 Thread Chris Murphy
On Thu, Aug 27, 2015 at 11:33 AM, Mike Aubury wrote: > # btrfs dev scan > Scanning for Btrfs filesystems > > (back to # prompt) > > > # mount -o ro,degraded /data > > > Seems to work, /data is mounted > > # btrfs fi show > Label: '0e36d290:data' uuid: e75a9856-d9e5-4d02-92e6-a217056c69b7 >

Re: Meta data full on a Readynas

2015-08-27 Thread Mike Aubury
# btrfs dev scan Scanning for Btrfs filesystems (back to # prompt) # mount -o ro,degraded /data Seems to work, /data is mounted # btrfs fi show Label: '0e36d290:data' uuid: e75a9856-d9e5-4d02-92e6-a217056c69b7 Total devices 4 FS bytes used 6.09TiB devid1 size 2.71TiB use

Re: Meta data full on a Readynas

2015-08-27 Thread Chris Murphy
On Thu, Aug 27, 2015 at 11:18 AM, Mike Aubury wrote: > Offlist - thanks for the help so far.. No, I'm changing it back to onlist. It's not appropriate to take this offlist. This whole conversation is relevant to others who end up in this same situation. And the ReadyNAS folks should have better

Re: Meta data full on a Readynas

2015-08-27 Thread Chris Murphy
On Thu, Aug 27, 2015 at 10:35 AM, Mike Aubury wrote: > Thanks for that. > I found something similar online - using a loop back device and a file > on a usb stick. > I created a 2GB file, and mounted that tried the balance - and once > completed - rebooted. OK but did you delete the loop device be

Re: Modifying a file in many snapshots

2015-08-27 Thread james harvey
Is there a way to do this? If not, is it a worthwhile feature request? On Thu, Aug 27, 2015 at 4:01 AM, james harvey wrote: > If this isn't possible, is there a way to check a given path/filename > on a btrfs filesystem, to show all the other reflinked path/filenames > to the same file? -- To un

Re: Meta data full on a Readynas

2015-08-27 Thread Mike Aubury
Thanks for that. I found something similar online - using a loop back device and a file on a usb stick. I created a 2GB file, and mounted that tried the balance - and once completed - rebooted. It seems to have fried the whole thing - won't mount at all now - with or without the usb device in place

Re: Meta data full on a Readynas

2015-08-27 Thread Chris Murphy
On Thu, Aug 27, 2015 at 4:02 AM, Mike Aubury wrote: > Hi, > Wondering if anyone can help me. > I've got a readynas which uses btrfs - and the meta data is full. > > root@ReadyNAS:~# uname -a > Linux ReadyNAS 3.0.101.RN_ARM.4 #1 Mon Jun 29 19:02:35 PDT 2015 armv7l > GNU/Linux > root@ReadyNAS:~#

[PATCH 3/3] btrfs-progs: add memory allocation fail check in btrfs_add_to_fsid()

2015-08-27 Thread Byongho Lee
In btrfs_add_to_fsid(), strdup() allocates memory to device->name, but the return value is not checked. So add the return value check and error handling code. And clean-up error handling code for ENOMEM case. Signed-off-by: Byongho Lee --- utils.c | 20 1 file changed, 12 in

[PATCH 2/3] btrfs-progs: fix memory leak in btrfs-map-logical main()

2015-08-27 Thread Byongho Lee
In btrfs-map-logical main(), strdup() allocates memory to output_file, but that memory is not freed. So add missing free() calls before return. Signed-off-by: Byongho Lee --- btrfs-map-logical.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/btrfs-map-logical.c b/btrfs-map-logical.c index

[PATCH 0/3] btrfs-progs: Small fixes for code using strdup()

2015-08-27 Thread Byongho Lee
1. fix memory leak in btrfs-convert main() 2. fix memory leak in btrfs-map-logical main() 3. add memory allocation fail check in btrfs_add_to_fsid() Byongho Lee (3): btrfs-progs: fix memory leak in btrfs-convert main() btrfs-progs: fix memory leak in btrfs-map-logical main() btrfs-progs: add

[PATCH 1/3] btrfs-progs: fix memory leak in btrfs-convert main()

2015-08-27 Thread Byongho Lee
In btrfs-convert main(), strdup() allocates memory to fslabel but that memory is not freed. We could fix it by adding free() calls to every return point, but that would make the code messy because there are several return paths. So I fix it by changing the code using strdup() with local array and s

[PATCH 2/4] btrfs-progs: Use common unit parser for btrfs filesystem command

2015-08-27 Thread Zhao Lei
Move to use get_unit_mode_from_arg() for cmds-filesystem.c, to make "btrfs filesystem df/show/usage"'s unit argument same. Also have cleanup effect: 18 insertions(+), 178 deletions(-) Signed-off-by: Zhao Lei --- cmds-fi-usage.c | 79 --- cmds-filesystem.c | 12

[PATCH 3/4] btrfs-progs: Use common unit parser for btrfs device command

2015-08-27 Thread Zhao Lei
Move to use get_unit_mode_from_arg() for cmds-device.c, to make "btrfs device usage"'s unit argument same with other tools. Signed-off-by: Zhao Lei --- cmds-device.c | 74 ++- 1 file changed, 7 insertions(+), 67 deletions(-) diff --git a/c

[PATCH 4/4] btrfs-progs: Use common unit parser for btrfs qgroup command

2015-08-27 Thread Zhao Lei
Move to use get_unit_mode_from_arg() for btrfs qgroup command, to make "btrfs qgroup show"'s unit argument same with other tools. Signed-off-by: Zhao Lei --- cmds-qgroup.c | 47 --- 1 file changed, 4 insertions(+), 43 deletions(-) diff --git a/cmds-qg

[PATCH 1/4] btrfs-progs: Introduce get_unit_mode_from_arg for common use

2015-08-27 Thread Zhao Lei
We are using separate code for parse unit mode in current code, result is each command have different argument for unit mode: # btrfs filesystem show --help ... --raw raw numbers in bytes --human-readable human friendly numbers, base 1024 (default) --iec us

[PATCH 0/4] btrfs-progs: Use common function to parse unit arguments

2015-08-27 Thread Zhao Lei
We are using separate code for parse unit mode in current code, result is each command have different argument for unit mode: # btrfs filesystem show --help ... --raw raw numbers in bytes --human-readable human friendly numbers, base 1024 (default) --iec us

Re: Understanding BTRFS storage

2015-08-27 Thread Austin S Hemmelgarn
On 2015-08-26 22:58, Duncan wrote: Austin S Hemmelgarn posted on Wed, 26 Aug 2015 08:03:40 -0400 as excerpted: On 2015-08-26 07:50, Roman Mamedov wrote: On Wed, 26 Aug 2015 10:56:03 +0200 George Duffield wrote: I'm looking to switch from a 5x3TB mdadm raid5 array to a Btrfs based solution t

Re: [PATCH] btrfs: Fixed dsize and last_off declarations

2015-08-27 Thread David Sterba
On Sun, Aug 23, 2015 at 04:01:42PM +, Alexandru Moise wrote: > The return values of btrfs_item_offset_nr and btrfs_item_size_nr are of > type u32. To avoid mixing signed and unsigned integers we should also > declare dsize and last_off to be of type u32. > > Signed-off-by: Alexandru Moise <00m

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

2015-08-27 Thread Liu Bo
On Mon, Aug 24, 2015 at 05:34:17PM +0530, Chandan Rajendra wrote: > 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: 2

Meta data full on a Readynas

2015-08-27 Thread Mike Aubury
Hi, Wondering if anyone can help me. I've got a readynas which uses btrfs - and the meta data is full. root@ReadyNAS:~# uname -a Linux ReadyNAS 3.0.101.RN_ARM.4 #1 Mon Jun 29 19:02:35 PDT 2015 armv7l GNU/Linux root@ReadyNAS:~# btrfs --version Btrfs v3.17.3 root@ReadyNAS:~# btrfs fi show Label:

Re: [PATCH RFC 00/14] Yet Another In-band(online) deduplication implement

2015-08-27 Thread David Sterba
On Mon, Aug 03, 2015 at 03:18:55PM +0800, Qu Wenruo wrote: > >> Implement details includes the following: > >> 1) LRU hash maps to limit the memory usage > >> The hash -> extent mapping is control by LRU (or unlimited), to > >> get a controllable memory usage (can be tuned by mount option)