Commit 78c4a49a authored by Linus Torvalds's avatar Linus Torvalds

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
parents 9b81d512 c2489e07
...@@ -809,6 +809,13 @@ static int splice_from_pipe_feed(struct pipe_inode_info *pipe, struct splice_des ...@@ -809,6 +809,13 @@ static int splice_from_pipe_feed(struct pipe_inode_info *pipe, struct splice_des
*/ */
static int splice_from_pipe_next(struct pipe_inode_info *pipe, struct splice_desc *sd) static int splice_from_pipe_next(struct pipe_inode_info *pipe, struct splice_desc *sd)
{ {
/*
* Check for signal early to make process killable when there are
* always buffers available
*/
if (signal_pending(current))
return -ERESTARTSYS;
while (!pipe->nrbufs) { while (!pipe->nrbufs) {
if (!pipe->writers) if (!pipe->writers)
return 0; return 0;
...@@ -884,6 +891,7 @@ ssize_t __splice_from_pipe(struct pipe_inode_info *pipe, struct splice_desc *sd, ...@@ -884,6 +891,7 @@ ssize_t __splice_from_pipe(struct pipe_inode_info *pipe, struct splice_desc *sd,
splice_from_pipe_begin(sd); splice_from_pipe_begin(sd);
do { do {
cond_resched();
ret = splice_from_pipe_next(pipe, sd); ret = splice_from_pipe_next(pipe, sd);
if (ret > 0) if (ret > 0)
ret = splice_from_pipe_feed(pipe, sd, actor); ret = splice_from_pipe_feed(pipe, sd, actor);
......
...@@ -162,15 +162,8 @@ void sysv_set_inode(struct inode *inode, dev_t rdev) ...@@ -162,15 +162,8 @@ void sysv_set_inode(struct inode *inode, dev_t rdev)
inode->i_fop = &sysv_dir_operations; inode->i_fop = &sysv_dir_operations;
inode->i_mapping->a_ops = &sysv_aops; inode->i_mapping->a_ops = &sysv_aops;
} else if (S_ISLNK(inode->i_mode)) { } else if (S_ISLNK(inode->i_mode)) {
if (inode->i_blocks) {
inode->i_op = &sysv_symlink_inode_operations; inode->i_op = &sysv_symlink_inode_operations;
inode->i_mapping->a_ops = &sysv_aops; inode->i_mapping->a_ops = &sysv_aops;
} else {
inode->i_op = &simple_symlink_inode_operations;
inode->i_link = (char *)SYSV_I(inode)->i_data;
nd_terminate_link(inode->i_link, inode->i_size,
sizeof(SYSV_I(inode)->i_data) - 1);
}
} else } else
init_special_inode(inode, inode->i_mode, rdev); init_special_inode(inode, inode->i_mode, rdev);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment