From patchwork Tue Mar 30 13:45:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Stanley X-Patchwork-Id: 411734 Delivered-To: patch@linaro.org Received: by 2002:a17:906:5290:0:0:0:0 with SMTP id c16csp4369236ejm; Tue, 30 Mar 2021 06:48:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxxmY4HXe4p3uPwT7G8kDFh0HXsjlbAlEyzywJPfEiL/RS+voAchEaRvXwtpbQcIz0EKQCj X-Received: by 2002:a5d:4bcc:: with SMTP id l12mr34571570wrt.343.1617112095787; Tue, 30 Mar 2021 06:48:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617112095; cv=none; d=google.com; s=arc-20160816; b=J3R60emGEDyU2HKdpX6zfDYwD2J9wrDp5lJGDWNZGdiBj4QuADyMflWEvuK4eKyhhS dWZvgQYVpKPXtsqggtJEZTE4oigb9r9TuLzqtjr/VV2kZ26+XuvGMst/+00F/DhPZb7N jL5ryAKszRfjMm6fL1aGY1BrV/IxAHFpOatfoLIECcNlEBrNU+SCu7eqQ6Pt9XPGmpkv Mis1fkwbaOb7N/ve/TmEdmB9iZTwbjR208iE9+WDRsrVYnHldHhGlmajx8V37XroEUAp lis58MlvTRyJ5cFXvLTR9zy20yslhKtK4N3gYdmoByMR3OiO/sFOK9mLtzzMODLxsdR6 2wjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence :mime-version:message-id:date:subject:cc:to:from:dkim-signature :dkim-signature; bh=hnGB5+QW4Dy8aXNGHIeWuRLWdlVP1NYgWjEOCJNjn9Q=; b=BXRFrkFDp95URJFZVSHyWa8kX0YQsQmLKlHqdtqcLkWSPCBSk3sxySUJXsVjNil9Y8 LS+XXBCouvGUIVLDV72Nck/5dXsis1aVrvRjAYb3GdaU75eRSZmk0Ect8av6dcrdJ/kV WAxPIDWFgvfT+9KLSCX/t9uWUdC0qabSqic5GnZLdh86qYNbG7N60ex6EEn4edRIut9k 0iJI/YA8LiQ3mMiIPON3B2biUVVn03T77BIXnjgcXKsbH1Fxk2NZR4JwM3CdN2qPagRJ UgQR/RCsBsYR27qJmk3JlCz1gFqZC3QmJXbvV/9BcBGG5+kXBteyDNwgMBDJMn4LPymJ 7zCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=desiato.20200630 header.b="TSq7s/kI"; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=YtGQ65HJ; spf=pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 2001:8b0:10b:1:d65d:64ff:fe57:4e05 as permitted sender) smtp.mailfrom="linux-mtd-bounces+patch=linaro.org@lists.infradead.org" Return-Path: Received: from desiato.infradead.org (desiato.infradead.org. [2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by mx.google.com with ESMTPS id x20si2831043wmj.31.2021.03.30.06.48.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Mar 2021 06:48:15 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 2001:8b0:10b:1:d65d:64ff:fe57:4e05 as permitted sender) client-ip=2001:8b0:10b:1:d65d:64ff:fe57:4e05; Authentication-Results: mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=desiato.20200630 header.b="TSq7s/kI"; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=YtGQ65HJ; spf=pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 2001:8b0:10b:1:d65d:64ff:fe57:4e05 as permitted sender) smtp.mailfrom="linux-mtd-bounces+patch=linaro.org@lists.infradead.org" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=hnGB5+QW4Dy8aXNGHIeWuRLWdlVP1NYgWjEOCJNjn9Q=; b=TSq7s/kIAcHlg3B82O8L82L/k7 mfmgXAl8gZcCNLi6sPMkIgtcKAh3n4uX4ZxyNlNWeBY1SvIn6M8rPO74mBZz5axrnPa5lmogjoA0Y EzSszc722WBipMbYAF886ldCg76CoZVMglBnKUlMN8xgS+ckPPr3+UGkQKeHjFMWCog1Du8GLBFT3 enRQyOblAv30qY2RUixgDCZvPWjwZDgf8PEEYOYYp9xzYgUYDFNjXU2aDLUPfALYRR6TewE4maPeD tYhoeoyVxfT4fesKBMzewKJ465mV98V53kya0LXBDBipmxQ/5yO9SLY1RbCbvPlz1h+C1mGAOWcFS PfnI33ow==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lREix-003rb7-MA; Tue, 30 Mar 2021 13:48:03 +0000 Received: from mail-pl1-x632.google.com ([2607:f8b0:4864:20::632]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lREgw-003rKp-K4 for linux-mtd@lists.infradead.org; Tue, 30 Mar 2021 13:48:00 +0000 Received: by mail-pl1-x632.google.com with SMTP id f17so6193773plr.0 for ; Tue, 30 Mar 2021 06:45:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=8c5509vV/LgWSAQV021ydpvF5jynvLy8ktsJyCm1QGg=; b=YtGQ65HJmwMcsoK2FQ3uwftOrZ8tOMHCD7th69JjUf7giIY7ec4GxAJM07/XUJIwJF EKAPhSn5NktRq+fBDANX5b1uCH9GqUpfq/ZQK5du9hdSAnrcbH2675KQaJ0UZ2olRp+g CmiYyVAh3ivxbGyMWqqpc/LN80DBzHSLHcis8NXx6Y3IBKwl5ZIuk2olQX3dW/TpXcNg 1sJv6/nwl5FBir5bBrna2Y/gJ5dG8Q1vwTh9lkzbgc5bmyRMpv61tXpx3fRT7C5Idmz+ 711NHnl0eEO04IWfihtIVA2G7e8rObbyNRaVE0AAeEqGa/NdNshTf89tdeOOQWqOudkT WKKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :mime-version:content-transfer-encoding; bh=8c5509vV/LgWSAQV021ydpvF5jynvLy8ktsJyCm1QGg=; b=tQ+4xwSZOgZ990bTu4YkRkIgETXJLv6DtjYLuFwH5eI0oCYkORmluUFvTHGAapaYXP 0B24V6+8zrrwm69BZIwn1z3eZUmYJzd9NasaTB3oE/2Xx2boaxse6d5jE9iKaIPP7ePP eWLvQSsLc5HxWzf0iQLc/DSj2de2Snn4GX+p3yXP8vAQ0y9tpiLO7a6yz9ZbyRjX/LyH Q6+RNUHleGfMPWG2Elh3RrWL3mfRr83paWNAB2sX0IfagFrCeOckzNdKFhwEOAp3xCc/ kDz9khCIs7MUdeui6cLEtBkkwhnXwHpZwR/U1DX7N1CK6xefu5uukkogkosKSf4pCOaL PSeA== X-Gm-Message-State: AOAM531oEs6hGTh7NvFLPRJwzqOphQ6J1csBfV7bkSRF7RGO3AffrlrN o/sZbnVeBRq5oQCdjDusXbA= X-Received: by 2002:a17:90a:c289:: with SMTP id f9mr4432939pjt.105.1617111956260; Tue, 30 Mar 2021 06:45:56 -0700 (PDT) Received: from localhost.localdomain ([45.124.203.14]) by smtp.gmail.com with ESMTPSA id mr5sm2918531pjb.53.2021.03.30.06.45.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Mar 2021 06:45:55 -0700 (PDT) From: Joel Stanley To: David Woodhouse , Richard Weinberger , Al Viro , Kees Cook , Christoph Hellwig Cc: "William A . Kennington III" , Lei YU , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] jffs2: Hook up splice_write callback Date: Wed, 31 Mar 2021 00:15:37 +1030 Message-Id: <20210330134537.423447-1-joel@jms.id.au> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210330_144759_013578_CD1BCC42 X-CRM114-Status: GOOD ( 13.60 ) X-Spam-Score: 0.4 (/) X-Spam-Report: Spam detection software, running on the system "desiato.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: overlayfs using jffs2 as the upper filesystem would fail in some cases since moving to v5.10. The test case used was to run 'touch' on a file that exists in the lower fs, causing the modification time [...] Content analysis details: (0.4 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:632 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.2 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level mail domains are different 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [joel.stan[at]gmail.com] -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid 0.2 FREEMAIL_FORGED_FROMDOMAIN 2nd level domains in From and EnvelopeFrom freemail headers are different X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-mtd" Errors-To: linux-mtd-bounces+patch=linaro.org@lists.infradead.org overlayfs using jffs2 as the upper filesystem would fail in some cases since moving to v5.10. The test case used was to run 'touch' on a file that exists in the lower fs, causing the modification time to be updated. It returns EINVAL when the bug is triggered. A bisection showed this was introduced in v5.9-rc1, with commit 36e2c7421f02 ("fs: don't allow splice read/write without explicit ops"). Reverting that commit restores the expected behaviour. Some digging showed that this was due to jffs2 lacking an implementation of splice_write. (For unknown reasons the warn_unsupported that should trigger was not displaying any output). Adding this patch resolved the issue and the test now passes. Fixes: 36e2c7421f02 ("fs: don't allow splice read/write without explicit ops") Signed-off-by: Joel Stanley --- fs/jffs2/file.c | 1 + 1 file changed, 1 insertion(+) -- 2.30.2 ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/ Reviewed-by: Christoph Hellwig Tested-by: Lei YU diff --git a/fs/jffs2/file.c b/fs/jffs2/file.c index f8fb89b10227..4fc8cd698d1a 100644 --- a/fs/jffs2/file.c +++ b/fs/jffs2/file.c @@ -57,6 +57,7 @@ const struct file_operations jffs2_file_operations = .mmap = generic_file_readonly_mmap, .fsync = jffs2_fsync, .splice_read = generic_file_splice_read, + .splice_write = iter_file_splice_write, }; /* jffs2_file_inode_operations */