https://bugzilla.mindrot.org/show_bug.cgi?id=3979

            Bug ID: 3979
           Summary: Use reflink for fast cross filesystem copy and rename
           Product: Portable OpenSSH
           Version: 10.4p1
          Hardware: amd64
                OS: Solaris
            Status: NEW
          Severity: enhancement
          Priority: P5
         Component: sftp-server
          Assignee: [email protected]
          Reporter: [email protected]

The reflink() call provides a very fast mechanism to copy files. 
Unlike link() it isn't a pointer to the same file but a new file that
the underlying filesystem arranges to be a copy (but without it
manually reading/writing all the blocks).  For ZFS on Solaris you can
do cross file system copy within the ZFS storage pool.

The sftp-server copy-data can be implemented using reflink() with a
fallback to the existing read/write loop.

For sftp-server rename there is an existing method that uses
link/unlink  instead of rename.  Both the link/unlink method and rename
don't work across filesystem boundaries but a reflink/unlink will.

For the rename case while we could introduce a new protocol extension,
it seems simpler make this an implementation detail.  Note that because
of the [email protected] extension the OpenSSH sftp(1) client
would need to do 'rename -l old new' otherwise the extension is used
instead.

Attached is a patch that shows a proof of concept of how this could be
done. It isn't intended to be integration ready because there would
need to be appropriate checks added for the system having reflink.  It
has so far only been tested on Solaris 11.4 with OpenSSH 10.3 with an
SFTP client from an older OpenSSH release on Linux.

-- 
You are receiving this mail because:
You are watching the assignee of the bug.
_______________________________________________
openssh-bugs mailing list
[email protected]
https://lists.mindrot.org/mailman/listinfo/openssh-bugs

Reply via email to