diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2016-04-03 19:53:20 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2016-04-03 19:53:20 -0400 |
commit | 7367ab9157d6829351dd4aa404352402f064686c (patch) | |
tree | 810335bdb021051dd8de6b83c198145593e91912 | |
parent | bc61384dcdd82a6faabafecdcd80040625db5e40 (diff) | |
parent | 03cc0789a690eb9ab07070376252961caeae7441 (diff) |
Merge branch 'for-linus' into work.iov_iter
-rw-r--r-- | fs/namei.c | 10 | ||||
-rw-r--r-- | fs/splice.c | 3 |
2 files changed, 9 insertions, 4 deletions
diff --git a/fs/namei.c b/fs/namei.c index 794f81dce766..1d9ca2d5dff6 100644 --- a/fs/namei.c +++ b/fs/namei.c | |||
@@ -1740,15 +1740,17 @@ static int walk_component(struct nameidata *nd, int flags) | |||
1740 | nd->flags); | 1740 | nd->flags); |
1741 | if (IS_ERR(path.dentry)) | 1741 | if (IS_ERR(path.dentry)) |
1742 | return PTR_ERR(path.dentry); | 1742 | return PTR_ERR(path.dentry); |
1743 | if (unlikely(d_is_negative(path.dentry))) { | 1743 | |
1744 | dput(path.dentry); | ||
1745 | return -ENOENT; | ||
1746 | } | ||
1747 | path.mnt = nd->path.mnt; | 1744 | path.mnt = nd->path.mnt; |
1748 | err = follow_managed(&path, nd); | 1745 | err = follow_managed(&path, nd); |
1749 | if (unlikely(err < 0)) | 1746 | if (unlikely(err < 0)) |
1750 | return err; | 1747 | return err; |
1751 | 1748 | ||
1749 | if (unlikely(d_is_negative(path.dentry))) { | ||
1750 | path_to_nameidata(&path, nd); | ||
1751 | return -ENOENT; | ||
1752 | } | ||
1753 | |||
1752 | seq = 0; /* we are already out of RCU mode */ | 1754 | seq = 0; /* we are already out of RCU mode */ |
1753 | inode = d_backing_inode(path.dentry); | 1755 | inode = d_backing_inode(path.dentry); |
1754 | } | 1756 | } |
diff --git a/fs/splice.c b/fs/splice.c index 9947b5c69664..a6b87b7e0745 100644 --- a/fs/splice.c +++ b/fs/splice.c | |||
@@ -1143,6 +1143,9 @@ static long do_splice_to(struct file *in, loff_t *ppos, | |||
1143 | if (unlikely(ret < 0)) | 1143 | if (unlikely(ret < 0)) |
1144 | return ret; | 1144 | return ret; |
1145 | 1145 | ||
1146 | if (unlikely(len > MAX_RW_COUNT)) | ||
1147 | len = MAX_RW_COUNT; | ||
1148 | |||
1146 | if (in->f_op->splice_read) | 1149 | if (in->f_op->splice_read) |
1147 | splice_read = in->f_op->splice_read; | 1150 | splice_read = in->f_op->splice_read; |
1148 | else | 1151 | else |