aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-11-25 18:11:08 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2015-11-25 18:11:08 -0500
commit78c4a49a69e910a162b05e4e8727b9bdbf948f13 (patch)
tree530261397ea6da3252ecbbedda242a1d338251c7
parent9b81d512a4a89dadfd3887d1b4443eeb2c20c573 (diff)
parentc2489e07c0a71a56fb2c84bc0ee66cddfca7d068 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull vfs fixes from Al Viro: "A couple of fixes for sendfile lockups caught by Dmitry + a fix for ancient sysvfs symlink breakage" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: vfs: Avoid softlockups with sendfile(2) vfs: Make sendfile(2) killable even better fix sysvfs symlinks
-rw-r--r--fs/splice.c8
-rw-r--r--fs/sysv/inode.c11
2 files changed, 10 insertions, 9 deletions
diff --git a/fs/splice.c b/fs/splice.c
index 801c21cd77fe..4cf700d50b40 100644
--- a/fs/splice.c
+++ b/fs/splice.c
@@ -809,6 +809,13 @@ static int splice_from_pipe_feed(struct pipe_inode_info *pipe, struct splice_des
809 */ 809 */
810static int splice_from_pipe_next(struct pipe_inode_info *pipe, struct splice_desc *sd) 810static int splice_from_pipe_next(struct pipe_inode_info *pipe, struct splice_desc *sd)
811{ 811{
812 /*
813 * Check for signal early to make process killable when there are
814 * always buffers available
815 */
816 if (signal_pending(current))
817 return -ERESTARTSYS;
818
812 while (!pipe->nrbufs) { 819 while (!pipe->nrbufs) {
813 if (!pipe->writers) 820 if (!pipe->writers)
814 return 0; 821 return 0;
@@ -884,6 +891,7 @@ ssize_t __splice_from_pipe(struct pipe_inode_info *pipe, struct splice_desc *sd,
884 891
885 splice_from_pipe_begin(sd); 892 splice_from_pipe_begin(sd);
886 do { 893 do {
894 cond_resched();
887 ret = splice_from_pipe_next(pipe, sd); 895 ret = splice_from_pipe_next(pipe, sd);
888 if (ret > 0) 896 if (ret > 0)
889 ret = splice_from_pipe_feed(pipe, sd, actor); 897 ret = splice_from_pipe_feed(pipe, sd, actor);
diff --git a/fs/sysv/inode.c b/fs/sysv/inode.c
index 590ad9206e3f..02fa1dcc5969 100644
--- a/fs/sysv/inode.c
+++ b/fs/sysv/inode.c
@@ -162,15 +162,8 @@ void sysv_set_inode(struct inode *inode, dev_t rdev)
162 inode->i_fop = &sysv_dir_operations; 162 inode->i_fop = &sysv_dir_operations;
163 inode->i_mapping->a_ops = &sysv_aops; 163 inode->i_mapping->a_ops = &sysv_aops;
164 } else if (S_ISLNK(inode->i_mode)) { 164 } else if (S_ISLNK(inode->i_mode)) {
165 if (inode->i_blocks) { 165 inode->i_op = &sysv_symlink_inode_operations;
166 inode->i_op = &sysv_symlink_inode_operations; 166 inode->i_mapping->a_ops = &sysv_aops;
167 inode->i_mapping->a_ops = &sysv_aops;
168 } else {
169 inode->i_op = &simple_symlink_inode_operations;
170 inode->i_link = (char *)SYSV_I(inode)->i_data;
171 nd_terminate_link(inode->i_link, inode->i_size,
172 sizeof(SYSV_I(inode)->i_data) - 1);
173 }
174 } else 167 } else
175 init_special_inode(inode, inode->i_mode, rdev); 168 init_special_inode(inode, inode->i_mode, rdev);
176} 169}