Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9091969pxu; Mon, 28 Dec 2020 06:26:34 -0800 (PST) X-Google-Smtp-Source: ABdhPJxWKEHfDq2+J1ahJfXIAb/SdqToMCuGw5B9SJcVf9Xjexyg5GW+ZDTQ/4yuvMzICRVQFhjQ X-Received: by 2002:aa7:c60c:: with SMTP id h12mr42745772edq.145.1609165593916; Mon, 28 Dec 2020 06:26:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609165593; cv=none; d=google.com; s=arc-20160816; b=Iorg3GeNYBEvxs9/KOXlwCPT/qNPU6uNRBtsim4uSEUHIGMtTmcsNI6LB5OE4sijXi JC2id/bZ4DChAc3sYoSVxjaIl/1EvJUGkG+mPDwf1ljEXpZEmE3hLq4DsThcWhOKv3H+ uB5iFQyVH6P58Dh+WxKrH2/yBtJyEoyGS6XCWMrc87RwwjIuR2/y2jngZRWorJjOyVVb aNi4qOvGs51BFjS73c0mJsJA7PqCtdIjbNrTi49RhQco+02YhXbAZVSPXDC5zufLo9Sg z2GdFbZgBjOjmhBXkfAMlbI4zjL/gGbFA4fhPHGZo/IjerGdoPvTi5nHB4rXFOR8Ssdp Z0IA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=gue/WItsS/6KqetLea6PlpOlrqjcAwo+e5JrSrRZgIw=; b=od1PnJQBPhFaqYhve5wOYC9LYPHuTbzemVK7Pf2C5gUHuBGMYXiWDUTiK+RKlzk2BL 7yET0ThSjtBbJ/rxeEdtZiUvKvjngEbrVvmCpi9oi6xvR5xafChrD15QPK0vJWDsFuRu ACy4Ejedz30UPD1qJVBljOvmjjHdo98YkwLcmFmsMchpk77o10qtJtFZ0+mdOdyqJ4c4 ljDaq4ydMY1ZW9LyZ2PEclwMW0SuDbRVX1WbpxF0fvGf18tD77bc7gbg8AcsK1jeNB+y vOrwWPUZ+0tzMYG4nURJwkZ/6MiRZahkkKI6HQKfpG3rvC/LKHkpL5SBllvgBn4Ul/95 XZcw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=h+3WToUo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dq8si19171320ejc.750.2020.12.28.06.26.11; Mon, 28 Dec 2020 06:26:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=h+3WToUo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2502986AbgL1OYE (ORCPT + 99 others); Mon, 28 Dec 2020 09:24:04 -0500 Received: from mail.kernel.org ([198.145.29.99]:60020 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2439240AbgL1OX4 (ORCPT ); Mon, 28 Dec 2020 09:23:56 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id CA75C22CAF; Mon, 28 Dec 2020 14:23:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609165395; bh=hBUNVKBil8CIRkRX0SEmR023sBelO4cWLfyYWBPcvaQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=h+3WToUo9iynsFjTa2YRf/hXI1EJ9rhY/DioDNdQ7XnlG4p6LzO2tYt7r/sAJthmK HWYAI/lSuSS53tLvkRmw0OHu5mryRm4tkpwpzcJ3lFnn/eKqhSwpbhlN1VU3r9cynL Ul55ks6hvNYlQW3Q9hP6iDx+1IY6EOhexiauTO4g= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, =?UTF-8?q?Joan=20Bruguera=20Mic=C3=B3?= , Jussi Kivilinna , Christoph Hellwig , Linus Torvalds , Sasha Levin Subject: [PATCH 5.10 509/717] proc mountinfo: make splice available again Date: Mon, 28 Dec 2020 13:48:27 +0100 Message-Id: <20201228125045.347625595@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228125020.963311703@linuxfoundation.org> References: <20201228125020.963311703@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Linus Torvalds [ Upstream commit 14e3e989f6a5d9646b6cf60690499cc8bdc11f7d ] Since commit 36e2c7421f02 ("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ó Reported-by: Jussi Kivilinna Link: https://bugzilla.kernel.org/show_bug.cgi?id=209971 Cc: Greg Kroah-Hartman Cc: Christoph Hellwig Signed-off-by: Linus Torvalds Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- fs/proc_namespace.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) --- a/fs/proc_namespace.c +++ b/fs/proc_namespace.c @@ -320,7 +320,8 @@ static int mountstats_open(struct inode const struct file_operations proc_mounts_operations = { .open = mounts_open, - .read = seq_read, + .read_iter = seq_read_iter, + .splice_read = generic_file_splice_read, .llseek = seq_lseek, .release = mounts_release, .poll = mounts_poll, @@ -328,7 +329,8 @@ const struct file_operations proc_mounts const struct file_operations proc_mountinfo_operations = { .open = mountinfo_open, - .read = seq_read, + .read_iter = seq_read_iter, + .splice_read = generic_file_splice_read, .llseek = seq_lseek, .release = mounts_release, .poll = mounts_poll, @@ -336,7 +338,8 @@ const struct file_operations proc_mounti const struct file_operations proc_mountstats_operations = { .open = mountstats_open, - .read = seq_read, + .read_iter = seq_read_iter, + .splice_read = generic_file_splice_read, .llseek = seq_lseek, .release = mounts_release, };