mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 10:00:17 +00:00
proc mountinfo: make splice available again
[ Upstream commit14e3e989f6] Since commit36e2c7421f("fs: don't allow splice read/write without explicit ops") we've required that file operation structures explicitly enable splice support, rather than falling back to the default handlers. Most /proc files use the indirect 'struct proc_ops' to describe their file operations, and were fixed up to support splice earlier in commits 40be821d627c..b24c30c67863, but the mountinfo files interact with the VFS directly using their own 'struct file_operations' and got missed as a result. This adds the necessary support for splice to work for /proc/*/mountinfo and friends. Reported-by: Joan Bruguera Micó <joanbrugueram@gmail.com> Reported-by: Jussi Kivilinna <jussi.kivilinna@iki.fi> Link: https://bugzilla.kernel.org/show_bug.cgi?id=209971 Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Christoph Hellwig <hch@lst.de> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Sasha Levin <sashal@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
8f939abd81
commit
54677c80ba
@@ -320,7 +320,8 @@ static int mountstats_open(struct inode *inode, struct file *file)
|
|||||||
|
|
||||||
const struct file_operations proc_mounts_operations = {
|
const struct file_operations proc_mounts_operations = {
|
||||||
.open = mounts_open,
|
.open = mounts_open,
|
||||||
.read = seq_read,
|
.read_iter = seq_read_iter,
|
||||||
|
.splice_read = generic_file_splice_read,
|
||||||
.llseek = seq_lseek,
|
.llseek = seq_lseek,
|
||||||
.release = mounts_release,
|
.release = mounts_release,
|
||||||
.poll = mounts_poll,
|
.poll = mounts_poll,
|
||||||
@@ -328,7 +329,8 @@ const struct file_operations proc_mounts_operations = {
|
|||||||
|
|
||||||
const struct file_operations proc_mountinfo_operations = {
|
const struct file_operations proc_mountinfo_operations = {
|
||||||
.open = mountinfo_open,
|
.open = mountinfo_open,
|
||||||
.read = seq_read,
|
.read_iter = seq_read_iter,
|
||||||
|
.splice_read = generic_file_splice_read,
|
||||||
.llseek = seq_lseek,
|
.llseek = seq_lseek,
|
||||||
.release = mounts_release,
|
.release = mounts_release,
|
||||||
.poll = mounts_poll,
|
.poll = mounts_poll,
|
||||||
@@ -336,7 +338,8 @@ const struct file_operations proc_mountinfo_operations = {
|
|||||||
|
|
||||||
const struct file_operations proc_mountstats_operations = {
|
const struct file_operations proc_mountstats_operations = {
|
||||||
.open = mountstats_open,
|
.open = mountstats_open,
|
||||||
.read = seq_read,
|
.read_iter = seq_read_iter,
|
||||||
|
.splice_read = generic_file_splice_read,
|
||||||
.llseek = seq_lseek,
|
.llseek = seq_lseek,
|
||||||
.release = mounts_release,
|
.release = mounts_release,
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user