summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2016-05-02 19:49:46 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2016-05-02 19:49:46 -0400
commitdf889b363198d946c0286b3fb2cfcca18d08a029 (patch)
tree22846d29e33c6f01058d76b7aeccd64baa50731a /fs
parentce8644fcadc52da72e19ae9f0866fb3eb15d3df4 (diff)
parent10c64cea04d3c75c306b3f990586ffb343b63287 (diff)
Merge branch 'for-linus' into work.lookups
Diffstat (limited to 'fs')
-rw-r--r--fs/namei.c20
-rw-r--r--fs/splice.c3
2 files changed, 7 insertions, 16 deletions
diff --git a/fs/namei.c b/fs/namei.c
index f2d55c835bb9..85d19e6cc8c0 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -2946,22 +2946,10 @@ no_open:
dentry = lookup_real(dir, dentry, nd->flags);
if (IS_ERR(dentry))
return PTR_ERR(dentry);
-
- if (create_error) {
- int open_flag = op->open_flag;
-
- error = create_error;
- if ((open_flag & O_EXCL)) {
- if (!dentry->d_inode)
- goto out;
- } else if (!dentry->d_inode) {
- goto out;
- } else if ((open_flag & O_TRUNC) &&
- d_is_reg(dentry)) {
- goto out;
- }
- /* will fail later, go on to get the right error */
- }
+ }
+ if (create_error && !dentry->d_inode) {
+ error = create_error;
+ goto out;
}
looked_up:
path->dentry = dentry;
diff --git a/fs/splice.c b/fs/splice.c
index b018eb485019..dd9bf7e410d2 100644
--- a/fs/splice.c
+++ b/fs/splice.c
@@ -1143,6 +1143,9 @@ static long do_splice_to(struct file *in, loff_t *ppos,
if (unlikely(ret < 0))
return ret;
+ if (unlikely(len > MAX_RW_COUNT))
+ len = MAX_RW_COUNT;
+
if (in->f_op->splice_read)
splice_read = in->f_op->splice_read;
else