[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 zhao...@cn.fujitsu.com --- cmds-device.c | 74 ++- 1 file changed, 7 insertions(+), 67

[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 zhao...@cn.fujitsu.com --- cmds-fi-usage.c | 79 ---

[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 zhao...@cn.fujitsu.com --- cmds-qgroup.c | 47 --- 1 file changed, 4 insertions(+), 43 deletions(-)

[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

[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

Re: Meta data full on a Readynas

2015-08-27 Thread Chris Murphy
On Thu, Aug 27, 2015 at 11:33 AM, Mike Aubury m...@aubit.com 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 Chris Murphy
On Thu, Aug 27, 2015 at 11:41 AM, Chris Murphy li...@colorremedies.com wrote: On Thu, Aug 27, 2015 at 11:33 AM, Mike Aubury m...@aubit.com wrote: # btrfs dev scan Scanning for Btrfs filesystems (back to # prompt) # mount -o ro,degraded /data Seems to work, /data is mounted # btrfs fi

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

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 l...@time.to.get.psyced.org 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

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 l...@time.to.get.psyced.org 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

[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

Re: Meta data full on a Readynas

2015-08-27 Thread Chris Murphy
On Thu, Aug 27, 2015 at 10:35 AM, Mike Aubury m...@aubit.com 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

Re: Meta data full on a Readynas

2015-08-27 Thread Chris Murphy
On Thu, Aug 27, 2015 at 11:18 AM, Mike Aubury m...@aubit.com 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

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

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

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

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 jamespharve...@gmail.com 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

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

[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 bhlee.ker...@gmail.com --- btrfs-map-logical.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/btrfs-map-logical.c

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

[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

[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 bhlee.ker...@gmail.com --- utils.c | 20

Re: Meta data full on a Readynas

2015-08-27 Thread Chris Murphy
On Thu, Aug 27, 2015 at 4:02 AM, Mike Aubury m...@aubit.com 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

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

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 hack

[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

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,

Re: Btrfs crash since 4.1.4

2015-08-27 Thread Chris Murphy
On Thu, Aug 27, 2015 at 4:03 PM, Yasuo Ohgaki yohg...@ohgaki.net 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.

[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

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: 2769

[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 zhao...@cn.fujitsu.com ---

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

[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 zhao...@cn.fujitsu.com --- tests/misc-tests.sh | 4 +++-

[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 quwen...@cn.fujitsu.com --- new | 3 +++ 1 file changed, 3 insertions(+) diff --git a/new b/new index c734bdc..ab2af69 100755 --- a/new +++ b/new @@

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-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 dste...@suse.cz 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

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

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

2015-08-27 Thread Peng Tao
On Thu, Aug 27, 2015 at 6:52 AM, Dave Chinner da...@fromorbit.com wrote: On Wed, Aug 26, 2015 at 04:16:42PM +0800, Peng Tao wrote: Now that a few file systems are adding clone functionality, namingly btrfs, NFS (later in the series) and XFS

Re: [PATCH-RFC-RESEND 0/9] NFS/NFSD: add NFSv42 CLONE operation support

2015-08-27 Thread Peng Tao
On Wed, Aug 26, 2015 at 9:11 PM, Christoph Hellwig h...@infradead.org wrote: On Wed, Aug 26, 2015 at 04:16:41PM +0800, Peng Tao wrote: 2. vfs_file_clone_range() does not expect file systems to do data copy, and thus no rw_verify_area() required. While there is no physical copy involved, the

Re: btrfs no space BTRFS: block rsv returned -28

2015-08-27 Thread Stefan Priebe - Profihost AG
umount shows in dmesg: [296257.035209] BTRFS: space_info 4 has 28507439104 free, is not full [296257.035212] BTRFS: space_info total=135291469824, used=106783965184, pinned=0, reserved=0, may_use=1737547415552, readonly=65536 If i umount and remount the fs is working fine again. Disk space cache

Re: [PATCH-RFC-RESEND 2/9] vfs/btrfs: add .clone_range file operation

2015-08-27 Thread Peng Tao
On Wed, Aug 26, 2015 at 9:17 PM, Christoph Hellwig h...@infradead.org wrote: You need to eep the existing defintion, either as a duplicate with a comment, or by including the uapi fs.h and defininin it to the new name. OK. will keep it. Also this will break cifs, which uses the

Re: [PATCH-RFC-RESEND 5/9] nfs42: add .copy_range file operation

2015-08-27 Thread Peng Tao
On Thu, Aug 27, 2015 at 6:48 AM, Dave Chinner da...@fromorbit.com wrote: On Wed, Aug 26, 2015 at 04:16:46PM +0800, Peng Tao wrote: Signed-off-by: Peng Tao tao.p...@primarydata.com --- fs/nfs/nfs4file.c | 50 ++ 1 file changed, 50 insertions(+)

btrfs no space BTRFS: block rsv returned -28

2015-08-27 Thread Stefan Priebe - Profihost AG
Hi, today i had again the no space situation while having the device mounted with: enospc_debug # btrfs filesystem df /vmbackup/ Data, single: total=18.54TiB, used=17.94TiB System, DUP: total=32.00MiB, used=2.83MiB Metadata, DUP: total=126.00GiB, used=99.45GiB GlobalReserve, single:

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: 2769

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

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) alone

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 forumscollect...@gmail.com wrote: I'm looking to switch from a 5x3TB mdadm raid5 array