From patchwork Mon Oct 24 11:29:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 8760 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp430340wru; Mon, 24 Oct 2022 05:41:16 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4EjHcAugYTMjYaOcWUxYPHKi85ymudziHW31be19h55x0SsA+MXP2r/qj2DIqfMs1YC1x6 X-Received: by 2002:a17:902:d483:b0:182:cb98:26e8 with SMTP id c3-20020a170902d48300b00182cb9826e8mr33321160plg.73.1666615276269; Mon, 24 Oct 2022 05:41:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666615276; cv=none; d=google.com; s=arc-20160816; b=k+9aOOEknU4HpPYd2qi0yo4BzX+gN5NDld7XD+VHewNs1EupCbGfcNLbIQ9m7ry3k5 SBriK12u0eBj5IjlrhW6/zeI2AvqGZQw8E/TGc7/TlgVkOZT8CYL8KpfzgOSdYN5nXOR nsiw/T33Q+cGCQkDubE24zFNwSbVbLhd8SkduZSHq5OXwj6bkodW4JASjvE2XmaZsreP pawdubw9nIM7BSfYuH8lDKLFAOVid+vjJz6dW1gSGy879J+VHz5HYHxF2X5qTTVN3VmW vP173JA9IKW6SCbp4o7NjJaYJr4x7SPXlk0lR16tIj+XzY3pVJX+cBRPsj13kjuTo4sW hFmg== 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=Kx5j+IQ6fsp2rfQvw/ji9pvosxCQFMEkSNPoLR43y2Q=; b=peQXaAqC4XpSrLyyHf71Je7KNbe0B4GnoWDzfp2u7q4g/G3vBnN7h5cEyezhh+IHWc Qm21zspQLeStM40psqVWXUAJfsG//kvvru2xp1oDmIrcmgpNmuPJzJqqbfmrmsJReIUU JvPLbGft0x0ZwQbYvUlCHUDOX+bAqt/IIju30k9VV98Ch899xs48qu5feO32Xc+6bvrn NlfgVHmkpjdkoI6hnHOx5V8zrGbsihlI9Mw5adg9YFDRq1a0d91OFw85+ZIRcCc6hTx3 kl39Gwb7KAZdxpcTQA/yqVPVElzgXxRW5z+q3ePxJRD3QSGIYZb5Jt4FAwerc/n7vHDk Ml1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=mWuJ3vJA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 64-20020a630243000000b0046ed54becf6si9774563pgc.678.2022.10.24.05.41.02; Mon, 24 Oct 2022 05:41:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=mWuJ3vJA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S234111AbiJXM3U (ORCPT + 99 others); Mon, 24 Oct 2022 08:29:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57948 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233840AbiJXM2X (ORCPT ); Mon, 24 Oct 2022 08:28:23 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AC69A86896; Mon, 24 Oct 2022 05:02:14 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id B8E3BB811C5; Mon, 24 Oct 2022 11:58:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 22D74C433D6; Mon, 24 Oct 2022 11:58:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666612706; bh=86Bdj7WnZgq0vHTIPVC4gQ4G8vTZJzy4bM/p2YB3db0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mWuJ3vJATPhOA6jpqFVOOXwNcxB3/JokuZY06Josn6pCiHCOCbnLumtVseY++zja0 DciItruDjKNoR5Dr3kvd5f393Fopi5/CSXPeE+dmQ7tGHGNzWQnxbuCZThhPLqAqBI KfdUYxYOPmVdv6JBDsxmyN3vEPXR+rIoSvIJE2d8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Saeed Mirzamohammadi , Sasha Levin Subject: [PATCH 4.19 049/229] Revert "fs: check FMODE_LSEEK to control internal pipe splicing" Date: Mon, 24 Oct 2022 13:29:28 +0200 Message-Id: <20221024113000.669471664@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024112959.085534368@linuxfoundation.org> References: <20221024112959.085534368@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747572779860325474?= X-GMAIL-MSGID: =?utf-8?q?1747572779860325474?= 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(-) --- a/fs/splice.c +++ b/fs/splice.c @@ -899,15 +899,17 @@ ssize_t splice_direct_to_actor(struct fi { 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; /*