Skip to content

Commit 78c4a49

Browse files
committed
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
2 parents 9b81d51 + c2489e0 commit 78c4a49

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

fs/splice.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -809,6 +809,13 @@ static int splice_from_pipe_feed(struct pipe_inode_info *pipe, struct splice_des
809809
*/
810810
static int splice_from_pipe_next(struct pipe_inode_info *pipe, struct splice_desc *sd)
811811
{
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+
812819
while (!pipe->nrbufs) {
813820
if (!pipe->writers)
814821
return 0;
@@ -884,6 +891,7 @@ ssize_t __splice_from_pipe(struct pipe_inode_info *pipe, struct splice_desc *sd,
884891

885892
splice_from_pipe_begin(sd);
886893
do {
894+
cond_resched();
887895
ret = splice_from_pipe_next(pipe, sd);
888896
if (ret > 0)
889897
ret = splice_from_pipe_feed(pipe, sd, actor);

fs/sysv/inode.c

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -162,15 +162,8 @@ void sysv_set_inode(struct inode *inode, dev_t rdev)
162162
inode->i_fop = &sysv_dir_operations;
163163
inode->i_mapping->a_ops = &sysv_aops;
164164
} else if (S_ISLNK(inode->i_mode)) {
165-
if (inode->i_blocks) {
166-
inode->i_op = &sysv_symlink_inode_operations;
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-
}
165+
inode->i_op = &sysv_symlink_inode_operations;
166+
inode->i_mapping->a_ops = &sysv_aops;
174167
} else
175168
init_special_inode(inode, inode->i_mode, rdev);
176169
}

0 commit comments

Comments
 (0)