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: 1460048 X-Patchwork-Delegate: richard@nod.at Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2001:8b0:10b:1:d65d:64ff:fe57:4e05; helo=desiato.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=desiato.20200630 header.b=TSq7s/kI; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=YtGQ65HJ; dkim-atps=neutral Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4F8rQ12Bq5z9sVt for ; Wed, 31 Mar 2021 00:48:39 +1100 (AEDT) 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-Google-Smtp-Source: ABdhPJwWDH3BQkfqOeU9t1w+ZAk375K8y/vuSEtzyEjTZ07vw37wh7R1AVhW922MDYuotjeu33+uZw== 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+incoming=patchwork.ozlabs.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 Reviewed-by: Christoph Hellwig Tested-by: Lei YU --- fs/jffs2/file.c | 1 + 1 file changed, 1 insertion(+) 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 */