]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/splice.c
Don't allow splice() to files opened with O_APPEND
[linux-2.6-omap-h63xx.git] / fs / splice.c
index 1bbc6f4bb09cb850cec29e64ea34bfabe083bb3b..a1e701c27156f78201532e8f701d1af2266744f0 100644 (file)
@@ -898,6 +898,9 @@ static long do_splice_from(struct pipe_inode_info *pipe, struct file *out,
        if (unlikely(!(out->f_mode & FMODE_WRITE)))
                return -EBADF;
 
+       if (unlikely(out->f_flags & O_APPEND))
+               return -EINVAL;
+
        ret = rw_verify_area(WRITE, out, ppos, len);
        if (unlikely(ret < 0))
                return ret;