From: David Disseldorp <ddiss@samba.org>
To: Christoph Hellwig <hch@infradead.org>
Cc: Jeremy Allison via samba-technical
<samba-technical@lists.samba.org>,
CIFS <linux-cifs@vger.kernel.org>,
Amir Goldstein <amir73il@gmail.com>,
metze@samba.org, Steve French <smfrench@gmail.com>,
vl@samba.org, Jeremy Allison <jra@samba.org>
Subject: Re: reflink support and Samba running over XFS
Date: Thu, 10 Nov 2022 16:05:03 +0100 [thread overview]
Message-ID: <20221110160503.4dd8b219@echidna.suse.de> (raw)
In-Reply-To: <Y2zjpE6f6WLtkqiz@infradead.org>
On Thu, 10 Nov 2022 03:42:28 -0800, Christoph Hellwig wrote:
> On Wed, Nov 09, 2022 at 11:30:55PM +0100, David Disseldorp via samba-technical wrote:
> > I think it's doable too :-). As indicated in my other mail, I think
> > FICLONERANGE will need to be used for FSCTL_DUP_EXTENTS_TO_FILE instead
> > of copy_file_range().
> > I'm not sure how to best handle FILE_SUPPORTS_BLOCK_REFCOUNTING -
> > ideally we'd set it for Btrfs and XFS(reflink=1) backed shares only.
> > Another option might be to advertise FILE_SUPPORTS_BLOCK_REFCOUNTING and
> > then propagate errors up to the client if FICLONERANGE fails for
> > FSCTL_DUP_EXTENTS_TO_FILE. Client copy fallback would work, but the
> > extra request overhead would be ugly.
>
> We could probably add a bit to struct statx if that is helpful for
> samba.
I think that'd be helpful for the above example.
The corresponding MS-FSA spec states:
2.1.5.9.4 FSCTL_DUPLICATE_EXTENTS_TO_FILE
...
The purpose of this operation is to make it look like a copy of a region from the source stream to the
target stream has occurred when in reality no data is actually copied. This operation modifies the
target stream's extent list such that, the same clusters are pointed to by both the source and target
streams' extent lists for the region being copied.
So it would appear that SMB clients can expect metadata I/O only.
There's one other SMB caveat which should be considered with any statx
changes, from MS-FSCC:
2.3.9 FSCTL_DUPLICATE_EXTENTS_TO_FILE_EX Request
...
When the DUPLICATE_EXTENTS_DATA_EX_SOURCE_ATOMIC
flag isn’t set, the behavior is identical to FSCTL_DUPLICATE_EXTENTS_TO_FILE. When the flag is set,
duplication is atomic from the source's point of view. It means duplication fully succeeds or fails
without side effect (when only part of source file region is duplicated).
Cheers, David
next prev parent reply other threads:[~2022-11-10 15:05 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-08 0:45 reflink support and Samba running over XFS Steve French
2022-11-08 0:53 ` Jeremy Allison
2022-11-08 6:47 ` Christoph Hellwig
2022-11-08 17:51 ` Jeremy Allison
2022-11-09 7:43 ` Christoph Hellwig
2022-11-09 9:32 ` Amir Goldstein
2022-11-09 18:38 ` Jeremy Allison
2022-11-09 18:47 ` Jeremy Allison
2022-11-09 19:24 ` Jeremy Allison
2022-11-09 22:30 ` David Disseldorp
2022-11-10 11:42 ` Christoph Hellwig
2022-11-10 15:05 ` David Disseldorp [this message]
2022-11-09 19:50 ` Amir Goldstein
2022-11-09 21:50 ` David Disseldorp
2022-11-10 11:41 ` Christoph Hellwig
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221110160503.4dd8b219@echidna.suse.de \
--to=ddiss@samba.org \
--cc=amir73il@gmail.com \
--cc=hch@infradead.org \
--cc=jra@samba.org \
--cc=linux-cifs@vger.kernel.org \
--cc=metze@samba.org \
--cc=samba-technical@lists.samba.org \
--cc=smfrench@gmail.com \
--cc=vl@samba.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox