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

2015-08-26 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 i

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

2015-08-26 Thread Peng Tao
On Thu, Aug 27, 2015 at 6:52 AM, Dave Chinner 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 >> (ttp://oss.sgi.com/archives/xfs/2015-06/msg00407.html), it makes s

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

2015-08-26 Thread Peng Tao
On Wed, Aug 26, 2015 at 9:11 PM, Christoph Hellwig 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 data logi

btrfs no space BTRFS: block rsv returned -28

2015-08-26 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: total=512.00M

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

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

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

2015-08-26 Thread Peng Tao
On Wed, Aug 26, 2015 at 9:17 PM, Christoph Hellwig 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 BTRFS_IOC_CLONE defintion > a

Re: Modifying a file in many snapshots

2015-08-26 Thread Chris Murphy
On Wed, Aug 26, 2015 at 9:31 PM, james harvey wrote: > I'm using btrfs and snapper. So, I have many periodic btrfs > snapshots, which are marked read-only (can of course be changed by > btrfs to r/w and changed back.) > > Let's say during my initial install I set a vimrc. And, let's say now > I

Re: Modifying a file in many snapshots

2015-08-26 Thread james harvey
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? On Thu, Aug 27, 2015 at 3:31 AM, james harvey wrote: > I'm using btrfs and snapper. So, I have many periodic btrfs > snapshots, which are

Modifying a file in many snapshots

2015-08-26 Thread james harvey
I'm using btrfs and snapper. So, I have many periodic btrfs snapshots, which are marked read-only (can of course be changed by btrfs to r/w and changed back.) Let's say during my initial install I set a vimrc. And, let's say now I want to change the vimrc, so that if I go back to any of the snap

Re: btrfs -o discard bug in latest dev branches

2015-08-26 Thread Jun He
Sorry, the filefrag -b option was not used correctly. Here are the new output: https://gist.github.com/junhe/b6ce39eeb6de8887e66a#file-btrfs-debug-tree-out https://gist.github.com/junhe/b6ce39eeb6de8887e66a#file-filefrag-out After doing fstrim /mnt/fsonloop https://gist.github.com/junhe/b6ce39eeb6

Re: Understanding BTRFS storage

2015-08-26 Thread Duncan
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 that will involve dupli

RE: [PATCH] btrfs: scrub: set error stats when tree block spanning stripes

2015-08-26 Thread Zhao Lei
Hi, David Sterba > -Original Message- > From: David Sterba [mailto:dste...@suse.cz] > Sent: Thursday, August 27, 2015 1:20 AM > To: Zhao Lei > Cc: linux-btrfs@vger.kernel.org > Subject: Re: [PATCH] btrfs: scrub: set error stats when tree block spanning > stripes > > On Tue, Aug 25, 2015

Re: [PATCH v5] fstests: btrfs: Add reserved space leak check for rewrite dirty page

2015-08-26 Thread Dave Chinner
On Wed, Aug 26, 2015 at 03:21:12PM +0800, Qu Wenruo wrote: > Eryu Guan wrote on 2015/08/26 14:41 +0800: > >Just one minor issue here, please remove $seqres.full before test, > >otherwise $seqres.full will keep growing. > > Oh, you're right. > I did forgot to remove it. > > BTW, is it better to add

Re: [GIT PULL] Fujitsu pull part1: cleanup

2015-08-26 Thread Qu Wenruo
Hi Chris, Any comment on the git pull? As it's not picked yet nor any objection here. Thanks, Qu Qu Wenruo wrote on 2015/08/21 10:18 +0800: Hi Chris, Would you please consider merging the following fixes for your integration-4.3 branch? https://github.com/adam900710/linux.git for_chris_4.3_p

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

2015-08-26 Thread Qu Wenruo
Qu Wenruo wrote on 2015/08/03 15:18 +0800: David Sterba wrote on 2015/07/28 16:50 +0200: On Tue, Jul 28, 2015 at 04:30:36PM +0800, Qu Wenruo wrote: Although Liu Bo has already submitted a V10 version of his deduplication implement, here is another implement for it. What's the reason to st

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

2015-08-26 Thread Dave Chinner
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 > (ttp://oss.sgi.com/archives/xfs/2015-06/msg00407.html), it makes sense > to pull the ioctl to common code. > > Add vfs_file_

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

2015-08-26 Thread Dave Chinner
On Wed, Aug 26, 2015 at 04:16:46PM +0800, Peng Tao wrote: > Signed-off-by: Peng Tao > --- > fs/nfs/nfs4file.c | 50 ++ > 1 file changed, 50 insertions(+) > > diff --git a/fs/nfs/nfs4file.c b/fs/nfs/nfs4file.c > index dcd39d4..c335cb0 100644 > --- a

Re: Btrfs duperemove corrupt data while dedup

2015-08-26 Thread Hugo Mills
On Wed, Aug 26, 2015 at 10:33:38PM +0300, Timofey Titovets wrote: > Hello guys, > i like btrfs, and i want put it in production soon, > one of the feature that i want use, is a deduplication. > > i frequently testing duperemove on btrfs and already see this problem before. > i know what btrfs befo

Re: Btrfs duperemove corrupt data while dedup

2015-08-26 Thread Roman Mamedov
On Wed, 26 Aug 2015 22:33:38 +0300 Timofey Titovets wrote: > what i've got (full diff in attach): > --- /home/nefelim4ag/dedup.after2015-08-26 21:36:55.773452558 +0300 > +++ /home/nefelim4ag/dedup.before 2015-08-26 21:21:01.203600761 +0300 > @@ -25139,9 +25139,9 @@ caf9d41036e46b85d

Btrfs duperemove corrupt data while dedup

2015-08-26 Thread Timofey Titovets
Hello guys, i like btrfs, and i want put it in production soon, one of the feature that i want use, is a deduplication. i frequently testing duperemove on btrfs and already see this problem before. i know what btrfs before, change mtime while deduping, but after dedup fixes from Mark (https://gith

Re: Response to Bcachefs Claims

2015-08-26 Thread Vincent Olivier
I'm still parsing through the multi-device advices. Will be back on this when I'm done. And I'll probably switch distro to Archlinux which seems the way to go if one is using cutting-edge kernel features like Btrfs. As for the work on "Gotchas/Known Issues" on the Btrfs wiki, I also think that

Re: btrfs -o discard bug in latest dev branches

2015-08-26 Thread Jun He
Thanks for the info. In the attached reproducer, I don't do sync after running the workload (but I've tried that before.). Just to be sure, I ran again with sync and waited for 60 seconds before collecting data. The behavior was the same. Then I tried one more thing, which corrected btrfs behavio

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

2015-08-26 Thread Josef Bacik
On 08/25/2015 10:06 PM, Liu Bo wrote: 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 Mind to share more details of the

Re: [PATCH] btrfs: scrub: set error stats when tree block spanning stripes

2015-08-26 Thread David Sterba
On Tue, Aug 25, 2015 at 09:45:27PM +0800, Zhao Lei wrote: > It is better to show error stats to user when we found tree block > spanning stripes. > > On a btrfs created by old version of btrfs-convert: > Before patch: > # btrfs scrub start -B /dev/vdh > scrub done for 8b342d35-2904-41ab-b3cb-2

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

2015-08-26 Thread David Sterba
On Wed, Aug 26, 2015 at 09:21:54AM -0700, Darrick J. Wong wrote: > On Wed, Aug 26, 2015 at 03:37:23PM +0200, 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; >

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

2015-08-26 Thread Darrick J. Wong
On Wed, Aug 26, 2015 at 03:37:23PM +0200, 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

Re: btrfs -o discard bug in latest dev branches

2015-08-26 Thread Jun He
jun@jun-VirtualBox:~/workdir/b6ce39eeb6de8887e66a$ uname -r 4.2.0-rc5-integration-4.3+ https://gist.githubusercontent.com/junhe/b6ce39eeb6de8887e66a/raw/1cd84e6bb138eeb08dc07af2c44dedf99866bde0/btrfs-debug-tree.out https://gist.githubusercontent.com/junhe/b6ce39eeb6de8887e66a/raw/1cd84e6bb138eeb0

Re: [PATCH v2 2/2] btrfs-progs: use open_btrfs_dir for btrfs device command

2015-08-26 Thread David Sterba
On Wed, Aug 26, 2015 at 05:04:23PM +0800, Zhao Lei wrote: > We can use open_btrfs_dir() to check whether target dir is > in btrfs's mount point before open, instead of checking it in kernel > space of ioctl, and return fuzzy error message. > > Before patch: > # (/mnt/tmp is not btrfs mountpoint)

Re: [PATCH v2 1/2] btrfs-progs: Introduce open_btrfs_dir wrapper

2015-08-26 Thread David Sterba
On Wed, Aug 26, 2015 at 05:04:22PM +0800, Zhao Lei wrote: > This patch introduce open_btrfs_dir() to open a dir in btrfs > filesystem. > > It can be used for several tools in btrfs-progs. > > Signed-off-by: Zhao Lei I've renamed it to btrfs_open_dir and tweaked some error messages and applied,

Re: [PATCH] btrfs-progs: remove code for setup mntid in cmd_subvol_show

2015-08-26 Thread David Sterba
On Wed, Aug 26, 2015 at 10:16:14PM +0800, Zhao Lei wrote: > We don't need to use value of mntid in cmd_subvol_show(), no need > to get its value. > > Signed-off-by: Zhao Lei Right, the subvolume id is obtained by other means. Applied, thanks. -- To unsubscribe from this list: send the line "unsu

Re: FW: btrfs-progs: android build

2015-08-26 Thread David Sterba
On Mon, Aug 10, 2015 at 04:30:58PM +0900, 강상우 wrote: > I change the code that you are suggest. Well, it's still not exactly what I expected. I'll add the makefile bits from you patch and do the wrappers and ifdefs myself. It's not always straightfowratd how to do it so I'll need to experiment a bi

[PATCH] btrfs-progs: remove code for setup mntid in cmd_subvol_show

2015-08-26 Thread Zhao Lei
We don't need to use value of mntid in cmd_subvol_show(), no need to get its value. Signed-off-by: Zhao Lei --- cmds-subvolume.c | 8 +--- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/cmds-subvolume.c b/cmds-subvolume.c index 20e2c01..75ecd45 100644 --- a/cmds-subvolume.c +++

[PATCH 1/4] btrfs-progs: Fix infinite loop of btrfs subvolumn sync

2015-08-26 Thread Zhao Lei
We can trigger the bug by following operation: (no wait between commands 3~5) btrfs subvolume create /mnt/btrfs/mysubvol btrfs subvolume snapshot /mnt/btrfs/mysubvol /mnt/btrfs/mysubvol_snap btrfs subvolume delete /mnt/btrfs/mysubvol_snap btrfs subvolume delete /mnt/btrfs/mysubvol btrfs

[PATCH 4/4] btrfs-progs: Simplify all-subvolumn-clean condition for wait_for_subvolume_cleaning

2015-08-26 Thread Zhao Lei
Instead of using a dirty-subvolumn-counter in old code, this patch turn to use a simple and direct way: If (not dirty-subvolumn found in current loop) { return all_clean; } Signed-off-by: Zhao Lei --- cmds-subvolume.c | 15 +++ 1 file changed, 7 insertions(+), 8 deletions(-

[PATCH 3/4] btrfs-progs: Fix wrong return value of wait_for_subvolume_cleaning()

2015-08-26 Thread Zhao Lei
Reproduce: # btrfs subvolume sync /mnt/btrfs Subvolume id 323 is gone # echo $? 1 # Reason: wait_for_subvolume_cleaning() return !0 in right case, because value of ret is set to "is subvolume clean" state before return. Signed-off-by: Zhao Lei --- cmds-subvolume.c | 4 +++- 1 file change

[PATCH 2/4] btrfs-progs: Simplify memory allocation for enumerate_dead_subvols

2015-08-26 Thread Zhao Lei
No need prepare memory for enumerate_dead_subvols() in caller, and pass additional argument for allocated length. Just do every thing inside enumerate_dead_subvols(), it will not increase malloc count, but make code simple. Signed-off-by: Zhao Lei --- cmds-subvolume.c | 17 ++--- 1

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

2015-08-26 Thread David Sterba
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 bytes to the structure. > struct fstrim_range { > __u64 s

Re: btrfs -o discard bug in latest dev branches

2015-08-26 Thread Jeff Mahoney
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 8/26/15 12:04 AM, Jun He wrote: > Hi, I have been playing with btrfs discard for a while and found > that btrfs may fail to discard some extents with 'mount -o > discard'. I am aware of Jeff Mahoney's patches ( > https://patchwork.kernel.org/patch/6

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

2015-08-26 Thread Christoph Hellwig
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. Also this will break cifs, which uses the BTRFS_IOC_CLONE defintion already. -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in th

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

2015-08-26 Thread Christoph Hellwig
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 data logically is copied from file A to file B. So we still need all the ch

Re: [PATCH RFC 02/11] vfs/btrfs: add .clone_range file operation

2015-08-26 Thread Christoph Hellwig
On Wed, Aug 26, 2015 at 03:00:57PM +0200, David Sterba wrote: > > I thought it breaks ABI if we choose a different value for the type > > field of the ioctl. Am I misunderstanding it? > > The ioctl is now private to btrfs, you're going to define the new ABI so > it IMHO should use the generic file

Re: btrfs send/receive freezes a system

2015-08-26 Thread Austin S Hemmelgarn
On 2015-08-26 08:04, MASAKI Yuhsuke wrote: Hi Duncan, thank you for your reply. I understood it is guessed from development between 3.10 and 4.1. I will try to replace CentOS 7 Receiver with Manjaro (same as sender) and sync. I will report the result here anyway. If it doesn't work, I report it

Re: [PATCH RFC 02/11] vfs/btrfs: add .clone_range file operation

2015-08-26 Thread David Sterba
On Wed, Aug 26, 2015 at 04:31:09PM +0800, Peng Tao wrote: > >> -#define BTRFS_IOC_CLONE_IOW(BTRFS_IOCTL_MAGIC, 9, int) > > > > The ioctl definition reuses the BTRFS_IOCTL_MAGIC (0x94), which is IMHO > > wrong. > > > I thought it breaks ABI if we choose a different value for the type > field

Re: Unmountable file system

2015-08-26 Thread Dan Hentschel
Thank you very much Chris and Duncan for your help. I appreciate it. I was able to restore all the files I needed from the filesystem. - dan On Tue, Aug 25, 2015 at 8:00 PM, Duncan <1i5t5.dun...@cox.net> wrote: > Dan Hentschel posted on Tue, 25 Aug 2015 11:11:44 -0400 as excerpted: > >> I can res

Re: btrfs send/receive freezes a system

2015-08-26 Thread MASAKI Yuhsuke
Hi Duncan, thank you for your reply. I understood it is guessed from development between 3.10 and 4.1. I will try to replace CentOS 7 Receiver with Manjaro (same as sender) and sync. I will report the result here anyway. If it doesn't work, I report it Kernel BTS. I searched distro for server u

Re: Understanding BTRFS storage

2015-08-26 Thread Austin S Hemmelgarn
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 that will involve duplicating a data store on a second machine for backup purposes (the machine is only powered up

Re: Understanding BTRFS storage

2015-08-26 Thread Duncan
George Duffield posted on Wed, 26 Aug 2015 10:56:03 +0200 as excerpted: > Two quick questions: > - If I were simply to create a Btrfs volume using 5x3TB drives and not > create a raid5/6/10 array I understand data would be striped across the > 5 drives with no reduncancy ... i.e. if a drive fails

Re: Understanding BTRFS storage

2015-08-26 Thread Roman Mamedov
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 that will involve duplicating a data store on a second > machine for backup purposes (the machine is only powered up for > backups). What do you want to ac

Re: Understanding BTRFS storage

2015-08-26 Thread Hugo Mills
On Wed, Aug 26, 2015 at 10:56:03AM +0200, George Duffield wrote: > Hi > > Is there a more comprehensive discussion/ documentation of Btrfs > features than is referenced in > https://btrfs.wiki.kernel.org/index.php/Main_Page...I'd love to learn > more but it seems there's no readily available autho

Re: Understanding BTRFS storage

2015-08-26 Thread Austin S Hemmelgarn
On 2015-08-26 04:56, George Duffield wrote: Hi Is there a more comprehensive discussion/ documentation of Btrfs features than is referenced in https://btrfs.wiki.kernel.org/index.php/Main_Page...I'd love to learn more but it seems there's no readily available authoritative documentation out ther

Fwd: Re: Response to Bcachefs Claims

2015-08-26 Thread Austin S Hemmelgarn
Forwarding to mailing list. Forwarded Message Delivered-To: ahferro...@gmail.com Received: by 10.37.50.211 with SMTP id y202csp1924867yby;Tue, 25 Aug 2015 16:16:17 -0700 (PDT) X-Received: by 10.68.249.66 with SMTP id ys2mr62584006pbc.82.1440544577187;Tue, 25 A

RE: [BUG] kernel BUG at fs/btrfs/scrub.c:1956!, when scrubbing freshly converted ext4

2015-08-26 Thread Zhao Lei
Hi, Yurii Kolesnykov > -Original Message- > From: Yurii Kolesnykov [mailto:yuriko...@gmail.com] > Sent: Wednesday, August 26, 2015 5:44 PM > To: Zhao Lei ; 'Chris Murphy' > ; 'Btrfs BTRFS' > Cc: 'Qu Wenruo' > Subject: Re: [BUG] kernel BUG at fs/btrfs/scrub.c:1956!, when scrubbing > fresh

Re: [BUG] kernel BUG at fs/btrfs/scrub.c:1956!, when scrubbing freshly converted ext4

2015-08-26 Thread Yurii Kolesnykov
Hi, Zhao Lei > > I reproduced above bug too, with following command: > mkfs.ext4 /dev/vdh > btrfs-convert /dev/vdh > mount /dev/vdh /mnt/tmp1 > btrfs scrub start -B /dev/vdh > (panic) > > The reason is: > 1: In some case, metadata(leaf) created by btrfs-convert was split into 2 > stri

[PATCH v2 1/2] btrfs-progs: Introduce open_btrfs_dir wrapper

2015-08-26 Thread Zhao Lei
This patch introduce open_btrfs_dir() to open a dir in btrfs filesystem. It can be used for several tools in btrfs-progs. Signed-off-by: Zhao Lei --- utils.c | 56 utils.h | 1 + 2 files changed, 57 insertions(+) diff --git a/utils.c b/

[PATCH v2 2/2] btrfs-progs: use open_btrfs_dir for btrfs device command

2015-08-26 Thread Zhao Lei
We can use open_btrfs_dir() to check whether target dir is in btrfs's mount point before open, instead of checking it in kernel space of ioctl, and return fuzzy error message. Before patch: # (/mnt/tmp is not btrfs mountpoint) # # btrfs device add -f /dev/sda13 /mnt/tmp ERROR: error adding

[PATCH v2 0/2] btrfs-progs: Introduce open_btrfs_dir wrapper

2015-08-26 Thread Zhao Lei
This patch introduce open_btrfs_dir() to open a dir in btrfs filesystem. It can be used for several tools in btrfs-progs. Changelog v1-v2: 1: Add error message for open_file failed case Zhao Lei (2): btrfs-progs: Introduce open_btrfs_dir wrapper btrfs-progs: use open_btrfs_dir for btrfs devi

Understanding BTRFS storage

2015-08-26 Thread George Duffield
Hi Is there a more comprehensive discussion/ documentation of Btrfs features than is referenced in https://btrfs.wiki.kernel.org/index.php/Main_Page...I'd love to learn more but it seems there's no readily available authoritative documentation out there? I'm looking to switch from a 5x3TB mdadm r

Re: [PATCH RFC 02/11] vfs/btrfs: add .clone_range file operation

2015-08-26 Thread Peng Tao
On Wed, Aug 26, 2015 at 4:01 PM, David Sterba wrote: > On Tue, Aug 25, 2015 at 11:33:40PM +0800, Peng Tao wrote: >> --- a/include/uapi/linux/btrfs.h >> +++ b/include/uapi/linux/btrfs.h >> @@ -316,12 +316,6 @@ struct btrfs_ioctl_search_args_v2 { >> __u64 buf[0]; /* out -

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

2015-08-26 Thread Peng Tao
Signed-off-by: Peng Tao --- fs/nfs/nfs4file.c | 50 ++ 1 file changed, 50 insertions(+) diff --git a/fs/nfs/nfs4file.c b/fs/nfs/nfs4file.c index dcd39d4..c335cb0 100644 --- a/fs/nfs/nfs4file.c +++ b/fs/nfs/nfs4file.c @@ -4,6 +4,7 @@ * Copyright

[PATCH-RFC-RESEND 6/9] nfs: get clone_blksize when probing fsinfo

2015-08-26 Thread Peng Tao
NFSv42 CLONE operation is supposed to respect it. Signed-off-by: Peng Tao --- fs/nfs/client.c | 1 + fs/nfs/nfs4proc.c | 1 + fs/nfs/nfs4xdr.c | 25 + include/linux/nfs4.h | 1 + include/linux/nfs_fs_sb.h | 1 + include/linux/nfs_xdr.h

[PATCH-RFC-RESEND 4/9] nfs42: add CLONE proc functions

2015-08-26 Thread Peng Tao
Signed-off-by: Peng Tao --- fs/nfs/nfs42.h| 1 + fs/nfs/nfs42proc.c| 71 +++ fs/nfs/nfs4proc.c | 3 +- include/linux/nfs_fs_sb.h | 1 + 4 files changed, 75 insertions(+), 1 deletion(-) diff --git a/fs/nfs/nfs42.h b/fs/nfs

[PATCH-RFC-RESEND 8/9] nfsd: Pass filehandle to nfs4_preprocess_stateid_op()

2015-08-26 Thread Peng Tao
From: Anna Schumaker This will be needed so COPY can look up the saved_fh in addition to the current_fh. Signed-off-by: Anna Schumaker --- fs/nfsd/nfs4proc.c | 16 +--- fs/nfsd/nfs4state.c | 5 ++--- fs/nfsd/state.h | 4 ++-- 3 files changed, 13 insertions(+), 12 deletions(-

[PATCH-RFC-RESEND 7/9] nfs42: respect clone_blksize

2015-08-26 Thread Peng Tao
draft-ietf-nfsv4-minorversion2-38.txt says: Both cl_src_offset and cl_dst_offset must be aligned to the clone block size Section 12.2.1. The number of bytes to be cloned must be a multiple of the clone block size, except in the case in which cl_src_offset plus the number of bytes to

[PATCH-RFC-RESEND 9/9] NFSD: Implement the CLONE call

2015-08-26 Thread Peng Tao
From: Anna Schumaker I can simply call vfs_file_clone_range() and have the vfs do the right thing for the filesystem being exported. Signed-off-by: Anna Schumaker [hch: change to implement the CLONE op instead of COPY] Signed-off-by: Christoph Hellwig Signed-off-by: Peng Tao --- fs/nfsd/nfs4

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

2015-08-26 Thread Peng Tao
Now that a few file systems are adding clone functionality, namingly btrfs, NFS (later in the series) and XFS (ttp://oss.sgi.com/archives/xfs/2015-06/msg00407.html), it makes sense to pull the ioctl to common code. Add vfs_file_clone_range() helper and .clone_range file operation interface to allo

[PATCH-RFC-RESEND 3/9] nfs42: add CLONE xdr functions

2015-08-26 Thread Peng Tao
xdr definitions per draft-ietf-nfsv4-minorversion2-38.txt Signed-off-by: Peng Tao --- fs/nfs/nfs42xdr.c | 97 - fs/nfs/nfs4xdr.c| 1 + include/linux/nfs4.h| 2 + include/linux/nfs_xdr.h | 19 ++ 4 files changed, 118 inse

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

2015-08-26 Thread Peng Tao
Also add vfs callers in do_vfs_ioctl(). Now btrfs CLONE ioctl goes through vfs_file_clone_range(). One question to btrfs developers: Does btrfs_clone() ever return a positive value? If it does, what does it mean to users? Signed-off-by: Peng Tao --- fs/btrfs/ctree.h | 2 ++ fs/btrfs/

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

2015-08-26 Thread Peng Tao
[resend ccing linux-fsdevel list and dropping the two nfs cleanup patches, which were sent to nfs list separately.] This patchset adds NFSv42 COPY support to nfs and nfsd. As suggested by Christoph, it pulls btrfs BTRFS_IOC_CLONE/BTRFS_IOC_CLONE_RANGE ioctls to generic layer and adds a new file

Re: [PATCH RFC 01/11] vfs: pull btrfs clone API to vfs layer

2015-08-26 Thread Peng Tao
On Wed, Aug 26, 2015 at 12:09 PM, Darrick J. Wong wrote: > On Tue, Aug 25, 2015 at 11:33:39PM +0800, Peng Tao wrote: >> Now that a few file systems are adding clone functionality, namingly >> btrfs, NFS (later in the series) and XFS >> (ttp://oss.sgi.com/archives/xfs/2015-06/msg00407.html), it mak

Re: [PATCH RFC 02/11] vfs/btrfs: add .clone_range file operation

2015-08-26 Thread David Sterba
On Tue, Aug 25, 2015 at 11:33:40PM +0800, Peng Tao wrote: > --- a/include/uapi/linux/btrfs.h > +++ b/include/uapi/linux/btrfs.h > @@ -316,12 +316,6 @@ struct btrfs_ioctl_search_args_v2 { > __u64 buf[0]; /* out - found items */ > }; > > -struct btrfs_ioctl_clone_range_

[PATCH v6] fstests: btrfs: Add reserved space leak check for rewrite dirty page

2015-08-26 Thread Qu Wenruo
Btrfs qgroup reserve codes lacks check for rewrite dirty page, causing every write, even rewriting a uncommitted dirty page, to reserve space. But only written data will free the reserved space, causing reserved space leaking. The bug exists almost from the beginning of btrfs qgroup codes, but no

Re: [PATCH v5] fstests: btrfs: Add reserved space leak check for rewrite dirty page

2015-08-26 Thread Qu Wenruo
Eryu Guan wrote on 2015/08/26 14:41 +0800: On Fri, Aug 21, 2015 at 09:17:14AM +0800, Qu Wenruo wrote: Btrfs qgroup reserve codes lacks check for rewrite dirty page, causing every write, even rewriting a uncommitted dirty page, to reserve space. But only written data will free the reserved spa