Re: [PATCH v5 9/9] btrfs: btrfs_copy_file_range() only supports reflinks

2015-10-17 Thread Chris Mason
On Sat, Oct 17, 2015 at 08:44:35AM +1100, Dave Chinner wrote: > > > When we're doing writes, it'll check the preallocated extents for extra > > refs and force COW if any exist. So writes into a preallocated region > > can enospc. > > This really seems like an btrfs interpretation/implementation

Re: [PATCH v5 9/9] btrfs: btrfs_copy_file_range() only supports reflinks

2015-10-16 Thread Dave Chinner
On Fri, Oct 16, 2015 at 09:19:50AM -0400, Chris Mason wrote: > On Fri, Oct 16, 2015 at 05:25:44AM -0700, Christoph Hellwig wrote: > > On Fri, Oct 16, 2015 at 07:49:19AM -0400, Chris Mason wrote: > > > > Yes, that would be my preference. I'd also like to understand what > > > > exactly btrfs does

Re: [PATCH v5 9/9] btrfs: btrfs_copy_file_range() only supports reflinks

2015-10-16 Thread Christoph Hellwig
On Fri, Oct 16, 2015 at 07:49:19AM -0400, Chris Mason wrote: > > Yes, that would be my preference. I'd also like to understand what > > exactly btrfs does in fallocate. > > For which part? The answer changes based on how many references there > are to a given fallocated region. Both cases.

Re: [PATCH v5 9/9] btrfs: btrfs_copy_file_range() only supports reflinks

2015-10-16 Thread Chris Mason
On Wed, Oct 14, 2015 at 11:00:45PM -0700, Christoph Hellwig wrote: > On Wed, Oct 14, 2015 at 11:46:08AM -0700, Darrick J. Wong wrote: > > The documentation for fallocate ought to be updated to include that as part > > of > > guaranteeing that subsequent writes to the range won't fail due to

Re: [PATCH v5 9/9] btrfs: btrfs_copy_file_range() only supports reflinks

2015-10-16 Thread Chris Mason
On Fri, Oct 16, 2015 at 05:25:44AM -0700, Christoph Hellwig wrote: > On Fri, Oct 16, 2015 at 07:49:19AM -0400, Chris Mason wrote: > > > Yes, that would be my preference. I'd also like to understand what > > > exactly btrfs does in fallocate. > > > > For which part? The answer changes based on

Re: [PATCH v5 9/9] btrfs: btrfs_copy_file_range() only supports reflinks

2015-10-15 Thread Dave Chinner
On Wed, Oct 14, 2015 at 11:46:08AM -0700, Darrick J. Wong wrote: > On Tue, Oct 13, 2015 at 12:29:59AM -0700, Christoph Hellwig wrote: > > On Mon, Oct 12, 2015 at 04:41:06PM -0700, Darrick J. Wong wrote: > > > One of the patches in last week's XFS reflink patchbomb adds > > > FALLOC_FL_UNSHARE > >

Re: [PATCH v5 9/9] btrfs: btrfs_copy_file_range() only supports reflinks

2015-10-15 Thread Christoph Hellwig
On Wed, Oct 14, 2015 at 11:46:08AM -0700, Darrick J. Wong wrote: > The documentation for fallocate ought to be updated to include that as part of > guaranteeing that subsequent writes to the range won't fail due to ENOSPC, > shared blocks will be unshared. > > Incidentally, btrfs leaves shared

Re: [PATCH v5 9/9] btrfs: btrfs_copy_file_range() only supports reflinks

2015-10-14 Thread Darrick J. Wong
On Tue, Oct 13, 2015 at 12:29:59AM -0700, Christoph Hellwig wrote: > On Mon, Oct 12, 2015 at 04:41:06PM -0700, Darrick J. Wong wrote: > > One of the patches in last week's XFS reflink patchbomb adds > > FALLOC_FL_UNSHARE > > flag; at the moment it _only_ forces copy-on-write of shared blocks, and

Re: [PATCH v5 9/9] btrfs: btrfs_copy_file_range() only supports reflinks

2015-10-13 Thread Christoph Hellwig
On Mon, Oct 12, 2015 at 04:41:06PM -0700, Darrick J. Wong wrote: > One of the patches in last week's XFS reflink patchbomb adds FALLOC_FL_UNSHARE > flag; at the moment it _only_ forces copy-on-write of shared blocks, and it > leaves holes alone. Yes, I've seen the implementation. > Obviously we

Re: [PATCH v5 9/9] btrfs: btrfs_copy_file_range() only supports reflinks

2015-10-12 Thread Pádraig Brady
On 11/10/15 15:29, Christoph Hellwig wrote: > On Wed, Sep 30, 2015 at 01:26:53PM -0400, Anna Schumaker wrote: >> Reject copies that don't have the COPY_FR_REFLINK flag set. > > I think a reflink actually is a perfectly valid copy, and I don't buy > the duplicate arguments in earlier threads. We

Re: [PATCH v5 9/9] btrfs: btrfs_copy_file_range() only supports reflinks

2015-10-12 Thread Christoph Hellwig
On Mon, Oct 12, 2015 at 11:23:05AM +0100, P??draig Brady wrote: > You're right that if the user doesn't notice, then there is no > point exposing this. However I think the user does notice as > there is a difference in the end state of the copy. I.E. generally > if there is a different end state

Re: [PATCH v5 9/9] btrfs: btrfs_copy_file_range() only supports reflinks

2015-10-12 Thread Darrick J. Wong
On Mon, Oct 12, 2015 at 07:34:44AM -0700, Christoph Hellwig wrote: > On Mon, Oct 12, 2015 at 11:23:05AM +0100, P??draig Brady wrote: > > You're right that if the user doesn't notice, then there is no > > point exposing this. However I think the user does notice as > > there is a difference in the

Re: [PATCH v5 9/9] btrfs: btrfs_copy_file_range() only supports reflinks

2015-10-11 Thread Christoph Hellwig
On Wed, Sep 30, 2015 at 01:26:53PM -0400, Anna Schumaker wrote: > Reject copies that don't have the COPY_FR_REFLINK flag set. I think a reflink actually is a perfectly valid copy, and I don't buy the duplicate arguments in earlier threads. We really need to think more in terms of how this

[PATCH v5 9/9] btrfs: btrfs_copy_file_range() only supports reflinks

2015-09-30 Thread Anna Schumaker
Reject copies that don't have the COPY_FR_REFLINK flag set. Signed-off-by: Anna Schumaker Reviewed-by: David Sterba --- fs/btrfs/ioctl.c | 4 1 file changed, 4 insertions(+) diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index