fs: return -EOPNOTSUPP if clone is not supported
[deliverable/linux.git] / fs / read_write.c
index 0c8782aa3d71364927b7e66f0237efb3c3aed772..dadf24e5c95bb7004d105f0773430576bfc57cf5 100644 (file)
@@ -1533,10 +1533,12 @@ int vfs_clone_file_range(struct file *file_in, loff_t pos_in,
 
        if (!(file_in->f_mode & FMODE_READ) ||
            !(file_out->f_mode & FMODE_WRITE) ||
-           (file_out->f_flags & O_APPEND) ||
-           !file_in->f_op->clone_file_range)
+           (file_out->f_flags & O_APPEND))
                return -EBADF;
 
+       if (!file_in->f_op->clone_file_range)
+               return -EOPNOTSUPP;
+
        ret = clone_verify_area(file_in, pos_in, len, false);
        if (ret)
                return ret;
This page took 0.024755 seconds and 5 git commands to generate.