Skip to content

Commit 14e3e98

Browse files
committed
proc mountinfo: make splice available again
Since commit 36e2c74 ("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 40be821..b24c30c, 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ó <[email protected]> Reported-by: Jussi Kivilinna <[email protected]> Link: https://bugzilla.kernel.org/show_bug.cgi?id=209971 Cc: Greg Kroah-Hartman <[email protected]> Cc: Christoph Hellwig <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 52cd5f9 commit 14e3e98

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

fs/proc_namespace.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -320,23 +320,26 @@ static int mountstats_open(struct inode *inode, struct file *file)
320320

321321
const struct file_operations proc_mounts_operations = {
322322
.open = mounts_open,
323-
.read = seq_read,
323+
.read_iter = seq_read_iter,
324+
.splice_read = generic_file_splice_read,
324325
.llseek = seq_lseek,
325326
.release = mounts_release,
326327
.poll = mounts_poll,
327328
};
328329

329330
const struct file_operations proc_mountinfo_operations = {
330331
.open = mountinfo_open,
331-
.read = seq_read,
332+
.read_iter = seq_read_iter,
333+
.splice_read = generic_file_splice_read,
332334
.llseek = seq_lseek,
333335
.release = mounts_release,
334336
.poll = mounts_poll,
335337
};
336338

337339
const struct file_operations proc_mountstats_operations = {
338340
.open = mountstats_open,
339-
.read = seq_read,
341+
.read_iter = seq_read_iter,
342+
.splice_read = generic_file_splice_read,
340343
.llseek = seq_lseek,
341344
.release = mounts_release,
342345
};

0 commit comments

Comments
 (0)