Reject copies that don't have the COPY_FR_REFLINK flag set. Signed-off-by: Anna Schumaker <Anna.Schumaker@xxxxxxxxxx> Reviewed-by: David Sterba <dsterba@xxxxxxxx> --- fs/btrfs/ioctl.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index d3697e8..c1f115d 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c @@ -44,6 +44,7 @@ #include <linux/uuid.h> #include <linux/btrfs.h> #include <linux/uaccess.h> +#include <linux/copy.h> #include "ctree.h" #include "disk-io.h" #include "transaction.h" @@ -3848,6 +3849,9 @@ ssize_t btrfs_copy_file_range(struct file *file_in, loff_t pos_in, { ssize_t ret; + if (!(flags & COPY_FR_REFLINK)) + return -EOPNOTSUPP; + ret = btrfs_clone_files(file_out, file_in, pos_in, len, pos_out); if (ret == 0) ret = len; -- 2.6.0 -- To unsubscribe from this list: send the line "unsubscribe linux-api" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html