From e0f8adc63ae2b5612fd4f02d358cbaae65ecd30c Mon Sep 17 00:00:00 2001 From: Sasha Levin Date: Sat, 15 Oct 2022 07:24:48 -0400 Subject: [PATCH] Fixes for 5.15 Signed-off-by: Sasha Levin --- ...fmode_lseek-to-control-internal-pipe.patch | 47 +++++++++++++++++++ queue-5.15/series | 1 + 2 files changed, 48 insertions(+) create mode 100644 queue-5.15/revert-fs-check-fmode_lseek-to-control-internal-pipe.patch create mode 100644 queue-5.15/series diff --git a/queue-5.15/revert-fs-check-fmode_lseek-to-control-internal-pipe.patch b/queue-5.15/revert-fs-check-fmode_lseek-to-control-internal-pipe.patch new file mode 100644 index 00000000000..d00b9cea32f --- /dev/null +++ b/queue-5.15/revert-fs-check-fmode_lseek-to-control-internal-pipe.patch @@ -0,0 +1,47 @@ +From a5e73c7fa86b41b250f3c25b2a82c7f7d0b0d39b Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sat, 15 Oct 2022 07:18:38 -0400 +Subject: 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 +Signed-off-by: Sasha Levin +--- + fs/splice.c | 10 ++++++---- + 1 file changed, 6 insertions(+), 4 deletions(-) + +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; + + /* +-- +2.35.1 + diff --git a/queue-5.15/series b/queue-5.15/series new file mode 100644 index 00000000000..6338472dbbf --- /dev/null +++ b/queue-5.15/series @@ -0,0 +1 @@ +revert-fs-check-fmode_lseek-to-control-internal-pipe.patch -- 2.47.3