Patch "Revert "fs: check FMODE_LSEEK to control internal pipe splicing"" has been added to the 5.15-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    Revert "fs: check FMODE_LSEEK to control internal pipe splicing"

to the 5.15-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     revert-fs-check-fmode_lseek-to-control-internal-pipe.patch
and it can be found in the queue-5.15 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit a5e73c7fa86b41b250f3c25b2a82c7f7d0b0d39b
Author: Sasha Levin <sashal@xxxxxxxxxx>
Date:   Sat Oct 15 07:18:38 2022 -0400

    Revert "fs: check FMODE_LSEEK to control internal pipe splicing"
    
    This reverts commit fd0a6e99b61e6c08fa5cf585d54fd956f70c73a6.
    
    Which was upstream commit 97ef77c52b789ec1411d360ed99dca1efe4b2c81.
    
    The commit is missing dependencies and breaks NFS tests, remove it for
    now.
    
    Reported-by: Saeed Mirzamohammadi <saeed.mirzamohammadi@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/fs/splice.c b/fs/splice.c
index 3abcd7fbc9f2..5dbce4dcc1a7 100644
--- a/fs/splice.c
+++ b/fs/splice.c
@@ -814,15 +814,17 @@ ssize_t splice_direct_to_actor(struct file *in, struct splice_desc *sd,
 {
 	struct pipe_inode_info *pipe;
 	long ret, bytes;
+	umode_t i_mode;
 	size_t len;
 	int i, flags, more;
 
 	/*
-	 * We require the input to be seekable, as we don't want to randomly
-	 * drop data for eg socket -> socket splicing. Use the piped splicing
-	 * for that!
+	 * We require the input being a regular file, as we don't want to
+	 * randomly drop data for eg socket -> socket splicing. Use the
+	 * piped splicing for that!
 	 */
-	if (unlikely(!(in->f_mode & FMODE_LSEEK)))
+	i_mode = file_inode(in)->i_mode;
+	if (unlikely(!S_ISREG(i_mode) && !S_ISBLK(i_mode)))
 		return -EINVAL;
 
 	/*



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux