Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 78c4a49a authored by Linus Torvalds's avatar Linus Torvalds
Browse files
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
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -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)
{
	/*
	 * Check for signal early to make process killable when there are
	 * always buffers available
	 */
	if (signal_pending(current))
		return -ERESTARTSYS;

	while (!pipe->nrbufs) {
		if (!pipe->writers)
			return 0;
@@ -884,6 +891,7 @@ ssize_t __splice_from_pipe(struct pipe_inode_info *pipe, struct splice_desc *sd,

	splice_from_pipe_begin(sd);
	do {
		cond_resched();
		ret = splice_from_pipe_next(pipe, sd);
		if (ret > 0)
			ret = splice_from_pipe_feed(pipe, sd, actor);
+2 −9
Original line number Diff line number Diff line
@@ -162,15 +162,8 @@ void sysv_set_inode(struct inode *inode, dev_t rdev)
		inode->i_fop = &sysv_dir_operations;
		inode->i_mapping->a_ops = &sysv_aops;
	} else if (S_ISLNK(inode->i_mode)) {
		if (inode->i_blocks) {
		inode->i_op = &sysv_symlink_inode_operations;
		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
		init_special_inode(inode, inode->i_mode, rdev);
}