udf: atomically read inode size
[sfrench/cifs-2.6.git] / fs / ioctl.c
index c415668c86d4cc727460ae0f0eb5a6d1f5840f61..cb9b02940805cba8d30720c0af63ec5174931c7e 100644 (file)
@@ -223,7 +223,11 @@ static long ioctl_file_clone(struct file *dst_file, unsigned long srcfd,
 
        if (!src_file.file)
                return -EBADF;
-       ret = vfs_clone_file_range(src_file.file, off, dst_file, destoff, olen);
+       ret = -EXDEV;
+       if (src_file.file->f_path.mnt != dst_file->f_path.mnt)
+               goto fdput;
+       ret = do_clone_file_range(src_file.file, off, dst_file, destoff, olen);
+fdput:
        fdput(src_file);
        return ret;
 }