vfs_copy_file_range and NFSv4.2 server-side copy

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The NFSv4.2 server-side copy feature was one of the original use cases that vfs_copy_file_range was designed to service.

As noted in Section 4 of draft-ietf-nfsv4-minorversion2-41 (soon to become RFC7862):

  The server-side copy features provide mechanisms which allow an NFS
   client to copy file data on a server or between two servers without
   the data being transmitted back and forth over the network through
   the NFS client.

The NFSv4.2 INTRA server-side copy feature off-loads a copy to a server when the copy source and destination files reside on the same NFS server.

The NFSv4.2 INTER server-side copy feature off-loads a copy by having the destination server first READ the file from the NFS source server and then WRITE the file to the local destination server file system.

In it’s current form, vfs_copy_file_range has a superblock equivalence test which returns -EXDEV if it fails.

       /* this could be relaxed once a method supports cross-fs copies */
        if (inode_in->i_sb != inode_out->i_sb)
                return -EXDEV;

The current upstream NFSv4.2 INTRA server-side copy feature uses vfs_copy_file_range, and because of the above check is currently limited to files that not only reside on the same NFS server, but reside on the same file system on the NFS server.

To fully service the NFSv4.2 INTRA server-side copy feature, vfs_copy_file_range would need to remove the -EXDEV check as per the comment.

The NFSv4.2 INTER server-side copy feature prototype also uses vfs_copy_file_range, and of course removes the above -EXDEV check to copy between the source and destination NFS servers.

In a recent review of the INTER server-side copy prototype patches, Christoph commented:

————
On Aug 20, 2016, at 2:18 AM, Christoph Hellwig <hch@xxxxxx> wrote:

On Fri, Aug 19, 2016 at 05:08:44PM -0400, J. Bruce Fields wrote:
> I thought I remembered Christoph (cc'd) arguing at the 2015 lsf/mm that
> there were some more issues that would need to be taken care of before
> we could turn on cross-device copies.

Yes.  Noi other VFS operation is supported between mountpoint, so
copy_file_range shouldn't be either.
————

As we pursue full NFSv4.2 server-side copy functionality in Linux, we need to an interface that allows the COPY operation (both INTRA and INTER) to operate between mountpoints.  While I agree with Christoph that no other VFS operation is supported between mountpoints, I don’t agree that is an argument for not allowing vfs_copy_file_range to operate across mountpoints.

I’d like opinions on two questions please:

1) Does the fact that no VFS operation operates across mountpoints stop vfs_copy_file_range from operating across mount points?

2)  What other issues are in the way of vfs_copy_file_range operating across mount points?

Thank you

—>Andy


��.n��������+%������w��{.n�����{��w���jg��������ݢj����G�������j:+v���w�m������w�������h�����٥




[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux