UPSTREAM: of/pci: Add helper function to parse max-link-speed from dt
[firefly-linux-kernel-4.4.55.git] / fs / cifs / ioctl.c
index 28a77bf1d55924693d27d1c701571e1b1fef2d49..35cf990f87d3245d01662cc550f4f3b43cc2dc58 100644 (file)
@@ -85,9 +85,14 @@ static long cifs_ioctl_clone(unsigned int xid, struct file *dst_file,
        src_tcon = tlink_tcon(smb_file_src->tlink);
        target_tcon = tlink_tcon(smb_file_target->tlink);
 
-       /* check if source and target are on same tree connection */
-       if (src_tcon != target_tcon) {
-               cifs_dbg(VFS, "file copy src and target on different volume\n");
+       /* check source and target on same server (or volume if dup_extents) */
+       if (dup_extents && (src_tcon != target_tcon)) {
+               cifs_dbg(VFS, "source and target of copy not on same share\n");
+               goto out_fput;
+       }
+
+       if (!dup_extents && (src_tcon->ses != target_tcon->ses)) {
+               cifs_dbg(VFS, "source and target of copy not on same server\n");
                goto out_fput;
        }