From patchwork Tue Jul 18 20:50:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Van Hensbergen X-Patchwork-Id: 122221 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c923:0:b0:3e4:2afc:c1 with SMTP id j3csp2011311vqt; Tue, 18 Jul 2023 14:10:29 -0700 (PDT) X-Google-Smtp-Source: APBJJlGu+hp8tcEPcevL3Apgm/wIBUyt7Y5lHyIStvy9ziFMnrS/1l0mLzILDhnZQNBD9ochGMHq X-Received: by 2002:a5d:4684:0:b0:313:fce9:c568 with SMTP id u4-20020a5d4684000000b00313fce9c568mr2961500wrq.31.1689714629561; Tue, 18 Jul 2023 14:10:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689714629; cv=none; d=google.com; s=arc-20160816; b=Ew6hEc9x3hZDptTgIKEOKTMTF9kqXKw5kpsZhb24C8WLWl+AWNb1hPFFk22WDWIEmi D7DVpMAgkLlLHcVrXU9Xx2MHtYeYWsh+tdCXb14Os9soe/iRmPY1xTIvgG0isx5yckoH iyd4TaHzDuGdec3UUvI4Uv7dqeIz7b6ajUHII6drLWw/xvWM3q4jeFGRUgUp+KgqiiGU Kd3h0UFcSxMvyEErBq2yfyvTiPRcH3C1yAJDVpQLyjCrUPz9DwKuuARuviHxaiB9OFid NHTkO7B59Mt5/gtNyLIu0vJlcAYnSFgXru0wYZQAmrZidyqGrwC1kByoEed23zN+89OC xEbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=OU/LMrpo2NQgYgj3zwfpum8gsvAiKNRs179Lc3oq6ms=; fh=j3YVng1RRZ6+ldvc9lS8NG/D3Vm7wGIMCbG7LdLsfsQ=; b=y3hSmav42N61owxt/nCh8J1V8r02mN9kTTycBAYHidaVuxj4oWifrWMEWJRlyOqENG WZJkneVhHoibP4DwpKmtFHqxzntRacZrwAAtBDnVbSv2hZbR0XJtNRPo68W0/bwhDt+v MXL4G7e+MAj2RyBk6cCXCP9Y3r12x3/M2YrryEW8q+CZNoMwrJMP3wt4K7z2lWJuWJx0 5wl3JTdbF1Wd3xOe1omwhUVSRp+Fwfoqql54EdWQVOQh8UVVciTQquEjVuvRGkhKxfyz aDAcml4EfAgMPIUS9YbhZ7eDwrMdW5C3NUw9TJzbnlcClM0E471+UyUPusNweeVrGx2h gg/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=j5IlBFob; 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=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id by26-20020a170906a2da00b00993150ec3c4si1681920ejb.970.2023.07.18.14.09.53; Tue, 18 Jul 2023 14:10:29 -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=@kernel.org header.s=k20201202 header.b=j5IlBFob; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230290AbjGRUuZ (ORCPT + 99 others); Tue, 18 Jul 2023 16:50:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52552 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230076AbjGRUuY (ORCPT ); Tue, 18 Jul 2023 16:50:24 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 82E19EC for ; Tue, 18 Jul 2023 13:50:23 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 21FE760F6B for ; Tue, 18 Jul 2023 20:50:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CE776C433CA; Tue, 18 Jul 2023 20:50:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1689713422; bh=2UE7/GpbCo0ZLCDtrowUpPJ2/RFcc5BlXQYiwH9D9H8=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=j5IlBFobm1C45XEvDknqzROzNQfPaWX0bWHKp0csPkt+XIXS3HvpQT7weNalAQBGd 444YCSDy5RF2bUDvqdrVbb65X7PeygRyBBxLB7Ry6+UkY7xdivw79Yq7poXZEDyDSs nMtChEgicZ6SeBP+OypSJaQhiXwqv32D9m+sg5vBmMjLYemeXgJHDV+etm3tdPppgn XYpNI7LtMHBbVtycvUHiESfWRyZ1sLGC+SvjH/uPBZ9RaaSO0dtc3vVGTYiI0+jppk RLqa6rZ/UHkB5J/BwZattvsKraOY8Xl9AilFQPdITysBiOis6jtxCDxUAMEcVxj2Wr Q6+WeH1OSUV9Q== From: Eric Van Hensbergen Date: Tue, 18 Jul 2023 20:50:15 +0000 Subject: [PATCH v2 1/4] fs/9p: remove unnecessary and overrestrictive check MIME-Version: 1.0 Message-Id: <20230716-fixes-overly-restrictive-mmap-v2-1-147d6b93f699@kernel.org> References: <20230716-fixes-overly-restrictive-mmap-v2-0-147d6b93f699@kernel.org> In-Reply-To: <20230716-fixes-overly-restrictive-mmap-v2-0-147d6b93f699@kernel.org> To: Latchesar Ionkov , Dominique Martinet , Christian Schoenebeck Cc: v9fs@lists.linux.dev, linux-kernel@vger.kernel.org, kernel@pengutronix.de, Robert Schwebel , Eric Van Hensbergen X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=853; i=ericvh@kernel.org; h=from:subject:message-id; bh=2UE7/GpbCo0ZLCDtrowUpPJ2/RFcc5BlXQYiwH9D9H8=; b=owEBbQKS/ZANAwAKAYj/1ftKX/+YAcsmYgBktvsMxhws6YtW15OsmDYDsLrt3VSaPGiYjno1y BPJ8rfcUaaJAjMEAAEKAB0WIQSWlvDRlqWQmKTK0VGI/9X7Sl//mAUCZLb7DAAKCRCI/9X7Sl// mB5JD/9jTRJO0ZCiXN97lvdEJl/K4A3/oYqIg+tEx3Eqz+D9M5xBYx6CnkB0dFTWVvVbgWgCrr3 qB73CX0HY2Awao3H5CON5bH9+jA6mMhPNgs2N2sOnykog1/Mo+sUzik2OLgh/tKHal0euSArUAY PQC36KETj3/c1PmYD4BzWOaK2EtOIqSHUvibdQsiKBW0IuA4yylvy+Udq9tpfmLHHK+ZGdM8ltH PH+BfrNhtiffgeb3Qo6q1HIxwJMfV2e3H05xpjvCxBINHc2Vtxv9A8bo8r3PjTEAHdYHW6cwP93 oAQGl0G78oKUV6btn2CO/qkStXzrailiktHxlTewZIUWmyAfaH/nuIYW81IdzNPBwb6/mqp57Qt RX+/1Iyn9HJVrLSAr3IxxPnIRQT+Biq0xBthfqkb2tqz7sOMt7Xg+J4QKVGckr6HLe923YmKZzo lyG1QIGj+I9/odfo/gSF+pzKDz6ya2V90ae1T9E7unM2tvwn/P6Z8FNbth6opOzFWpY3EpVEZoO OFdAmk9h2+sGL8zZ0o6XuviQUXRxMj6qIFxjzVMie6z8uyWIX0amZonHDVdRVWHLLhaI+pzy3Na VAoGAbD8WfWnXLDf+Ycdy1TYLquYOa9fbS7YljT3PDjBbSJTZK4o4Pt6Klj2FAYTuuICC3dO6uP tqyUECtCgkMna3A== X-Developer-Key: i=ericvh@kernel.org; a=openpgp; fpr=9696F0D196A59098A4CAD15188FFD5FB4A5FFF98 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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: INBOX X-GMAIL-THRID: 1771794207097287117 X-GMAIL-MSGID: 1771794207097287117 This eliminates a check for shared that was overrestrictive and duplicated a check in generic_file_readonly_mmap. Reviewed-by: Dominique Martinet Reviewed-by: Christian Schoenebeck Signed-off-by: Eric Van Hensbergen --- fs/9p/vfs_file.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/fs/9p/vfs_file.c b/fs/9p/vfs_file.c index 2996fb00387fa..bda3abd6646b8 100644 --- a/fs/9p/vfs_file.c +++ b/fs/9p/vfs_file.c @@ -506,8 +506,6 @@ v9fs_file_mmap(struct file *filp, struct vm_area_struct *vma) if (!(v9ses->cache & CACHE_WRITEBACK)) { p9_debug(P9_DEBUG_CACHE, "(no mmap mode)"); - if (vma->vm_flags & VM_MAYSHARE) - return -ENODEV; invalidate_inode_pages2(filp->f_mapping); return generic_file_readonly_mmap(filp, vma); } From patchwork Tue Jul 18 20:50:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Van Hensbergen X-Patchwork-Id: 122230 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c923:0:b0:3e4:2afc:c1 with SMTP id j3csp2016178vqt; Tue, 18 Jul 2023 14:20:55 -0700 (PDT) X-Google-Smtp-Source: APBJJlFK/t95n8ibxGRXO0GfrcKbNgADDmJmAvZ6hEFDc3fR0pqgoqP3fdssHkfIXZ+ZXs9ImWUy X-Received: by 2002:a92:c56c:0:b0:348:8b42:1860 with SMTP id b12-20020a92c56c000000b003488b421860mr4106340ilj.4.1689715255417; Tue, 18 Jul 2023 14:20:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689715255; cv=none; d=google.com; s=arc-20160816; b=t6HXbYwHpScXf1z8nGn9PqC3DVJ0pus6Gygs+P2UQMuMGroepe47Cye6CzLJ1X5u5O cUdknS1R7rJq5lSJ+L8rDxVjGsZPyp2/fpIeekWi3eBzZxw5hqXGEbP540VBsdSiNruT SjX3F2IlSpqsc5dY5CDgs54HH3kMGURjSRGtK5ctTKc63ZFuocyb8B1rGORbt5c2ky48 vpDjvmNto/016rDyZCF6k6ljm0fqNHR5vtS+nB2NrGIh5q+bIXI+v3zRMlQ+UjJIM8Q3 FvnSO/qcehQzJbyUSYgZs70Wrkqk21DjacJgVn+AsYlGFPZ/w5QQCG50xQmArA840gYV 9H4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=Eb5emN6weT1GtnPZ9mlWOI7oK7Sj1CYH1rqH/yJiQbw=; fh=j3YVng1RRZ6+ldvc9lS8NG/D3Vm7wGIMCbG7LdLsfsQ=; b=x9kbElVdgRF9tzjzwTPGPkVqn2Y+JkJTcDxahkGGcKxc6s9Be31GuryMju2JrCE+CV 4yF41j4UPJZgtGvTUgPedzSlPB+VG4hjdy8FST9XFJn2WIiDCQzSoJMDeMxkty1ss5jq mCa9CGYiNeXuthpj96aFBBBDt9siJZubNHzlP8tHPIAxLE1im7OHg88zpRpUmqVY1Jfs aVT9JxO3nSLmadOBfjRNzYUb7S5dcxmekE6ylIAwswV3OcwXTBhOdJd2GX6smwjbSCbY rvKlYsmo/znYZbVx3HuC7WCHeomXg3XXS1Ax2qiw2ETphoY9kMJ7NhypezVpAtC6bgQC YjZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=mv1be18M; 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=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g22-20020a17090ace9600b00257482b1795si38193pju.166.2023.07.18.14.20.41; Tue, 18 Jul 2023 14:20:55 -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=@kernel.org header.s=k20201202 header.b=mv1be18M; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230502AbjGRUua (ORCPT + 99 others); Tue, 18 Jul 2023 16:50:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52558 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230194AbjGRUuZ (ORCPT ); Tue, 18 Jul 2023 16:50:25 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8B761BD for ; Tue, 18 Jul 2023 13:50:24 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 22EF560F6B for ; Tue, 18 Jul 2023 20:50:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CAA3BC433C7; Tue, 18 Jul 2023 20:50:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1689713423; bh=U1llKZN9bzeNrf4u+gdKJoyKutM3P61zdD1PaebvrKY=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=mv1be18MbNRPYlwTJtC4FF7ZDNN9ZlxlX/kc4sR1PALY9hqAmPATw+pir6oYNSOGH iAkvo4d5tsqnzUYwc0XNlyN/jTyzsL1FvDa/GronlzxMce97cPrH/PmifKEqruIi5B 6bgXHdaFCmKh5m0Kl8T3JUUEQjR6kJ/JV3UakLH/DlObqOqF+oeMTOPSIU/9+uDRM2 ka09uqYajkzCypQzi4QVIadTRnH7B6zRPLDO2FnD4Sh6sqFRCyxJIWBy7HlrP44XOS 5t1HVJJYmD5GGW8RA52JTlmLk7NTz4cI8c/cTjbvkUEczIPp/MMUjmVgvb4zT/BIn1 +vBViqzS/fkhg== From: Eric Van Hensbergen Date: Tue, 18 Jul 2023 20:50:16 +0000 Subject: [PATCH v2 2/4] fs/9p: fix typo in comparison logic for cache mode MIME-Version: 1.0 Message-Id: <20230716-fixes-overly-restrictive-mmap-v2-2-147d6b93f699@kernel.org> References: <20230716-fixes-overly-restrictive-mmap-v2-0-147d6b93f699@kernel.org> In-Reply-To: <20230716-fixes-overly-restrictive-mmap-v2-0-147d6b93f699@kernel.org> To: Latchesar Ionkov , Dominique Martinet , Christian Schoenebeck Cc: v9fs@lists.linux.dev, linux-kernel@vger.kernel.org, kernel@pengutronix.de, Robert Schwebel , Eric Van Hensbergen X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=921; i=ericvh@kernel.org; h=from:subject:message-id; bh=U1llKZN9bzeNrf4u+gdKJoyKutM3P61zdD1PaebvrKY=; b=owEBbQKS/ZANAwAKAYj/1ftKX/+YAcsmYgBktvsMiEBMS24QIGDx7amfXvzIA6gDZVIz5JGk1 9UCcOkz9eeJAjMEAAEKAB0WIQSWlvDRlqWQmKTK0VGI/9X7Sl//mAUCZLb7DAAKCRCI/9X7Sl// mAi9EACZPCaFyixIwaKhfsBISAbZZ7dYCGXgefg/e4EIfgHCR+SMKdoaI7C0+tn4RF2NJQiKz3r QhemJUXk9gRiPoCk4ApRcIgNe2XErSs7A+R/i7nFTqsjSwrBWZ0VAE2YDQSQxGD+miOpR9Otzjw DCXGlLsRPgm4gCGH/PJMiAjMG3+cvVVvYAUS2ZZfhJLsr4WO1y9lrFGIve+/8UbBP8id3Eq+E8M OGY/N9Y20Enm+egiqqJkvCD7zJxIyxn+TzEjZBykD6DsQdKAmTfyyK7cIN2PznCBvsovwixTKKC 3sxdmbWlPcZh4pT1MiP8Mlq331UzgPAgiaemmYYHhYPa0hk9CLaRuCNYQ2GmXiRZ3KrW16+BEQl 1hJhEwvvejqMyZdP+jQ7C9+YVGu82rW+/CW4lD3iBLs++Sa2BZvVB1Uf5ma3cg1Ub0Y92hXpcQ3 EyhpNXUMGlMNixvsOV+ZJYg9chcGY5/nJbvRJcMUoIvPXt47AceelHzLnEyoTDuMfekXJrvDFnb bT+eZ/3baos4A2xrlfOxxji8K4qCH78/7O2teLVCKx4iSLdI17uTsRURXHfUxQhmywtJd+wjj/i GRD7MJifpXU5dWQ9LKKCuJckjpNrEBJvHCPN2NOFeTyA7obL2svqUW34W+Jiv8B+UI+0q+MNORX BJRIshvhPOR1fkw== X-Developer-Key: i=ericvh@kernel.org; a=openpgp; fpr=9696F0D196A59098A4CAD15188FFD5FB4A5FFF98 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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: INBOX X-GMAIL-THRID: 1771794863930386475 X-GMAIL-MSGID: 1771794863930386475 There appears to be a typo in the comparison statement for the logic which sets a file's cache mode based on mount flags. Reviewed-by: Christian Schoenebeck Reviewed-by: Dominique Martinet Signed-off-by: Eric Van Hensbergen --- fs/9p/fid.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/9p/fid.h b/fs/9p/fid.h index 0c51889a60b33..297c2c377e3dd 100644 --- a/fs/9p/fid.h +++ b/fs/9p/fid.h @@ -57,7 +57,7 @@ static inline void v9fs_fid_add_modes(struct p9_fid *fid, int s_flags, (s_flags & V9FS_DIRECT_IO) || (f_flags & O_DIRECT)) { fid->mode |= P9L_DIRECT; /* no read or write cache */ } else if ((!(s_cache & CACHE_WRITEBACK)) || - (f_flags & O_DSYNC) | (s_flags & V9FS_SYNC)) { + (f_flags & O_DSYNC) || (s_flags & V9FS_SYNC)) { fid->mode |= P9L_NOWRITECACHE; } } From patchwork Tue Jul 18 20:50:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Van Hensbergen X-Patchwork-Id: 122229 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c923:0:b0:3e4:2afc:c1 with SMTP id j3csp2015521vqt; Tue, 18 Jul 2023 14:19:24 -0700 (PDT) X-Google-Smtp-Source: APBJJlE70v7kmE5muARuhsxqhqHlYjmZyeuPCgbllceuUlydgf0HIdMcdqtdGzdxVJ9gQwy2sTgO X-Received: by 2002:a17:90a:db12:b0:262:f273:4a20 with SMTP id g18-20020a17090adb1200b00262f2734a20mr11889390pjv.42.1689715164278; Tue, 18 Jul 2023 14:19:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689715164; cv=none; d=google.com; s=arc-20160816; b=d5356Tcjb7Mdj73Glf0Jb0GmWUiDf+tJKeNgsOyZA+nfBXBzSxHJwf+Bu86y33K7qZ tqaFbFJzRlMPE1WEbYi0DIgJcQOoczTMqnwHGLlbb3hO4h51k3uxkTO2jfnVWYuOsY7M xPjISM3/rCAyG9uVqZsDJv+z1uk5+FeTdDDEh/BSP2yP1mvRFwp66B+oim4Rs6pHZVMl O2FNILE1Zd2ta+URDry3C2BGGA7+x/r2IOvW6Gtj6E3tx96yCOXcxzLtITIRD9kCxuXD WYJTKJlJZM42KhE2uE95deChGfrMnAUBd/M/IrM282WLC74REyRldeeiRkWHDCDDNl7g LZAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=OyRDFfo6eabht8US4t66uGTNsl+u78SCo/s4j8qRmws=; fh=j3YVng1RRZ6+ldvc9lS8NG/D3Vm7wGIMCbG7LdLsfsQ=; b=YBlNQiDmzNnYXhIwRrQdMjcFtsVY+tpBPY+57NAmH4HNMHoo3oYm7CCMIDG1MkdUoR GTTt/G9Ij88g1zhxrmmucIFc+vAx/hcm8TnsMoPoEg6PvwAxPIn+NWdSJedx+udc4DOV HyGFMvnbOvGTs88vW0KjTb4T4O44z54XqfMlbHzv6kZkkPm930jHES825KcqsNcu0niP Yk/rSqd1/5+YiEeWtCEYXOP/1lhZ+G0AeHUFrM7j+1mdlYmvAjGgJFgkbYSTGTew6zok xygI8uWCWdavxqUpnNrAQZuzcEpu+KBfET79WlJ0pnaEN/mbfnYlGehfH97Ele9lDNPf aOUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Ov7F4c87; 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=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id mh3-20020a17090b4ac300b00267afeac976si56018pjb.128.2023.07.18.14.19.10; Tue, 18 Jul 2023 14:19:24 -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=@kernel.org header.s=k20201202 header.b=Ov7F4c87; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230522AbjGRUuc (ORCPT + 99 others); Tue, 18 Jul 2023 16:50:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52566 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229708AbjGRUu0 (ORCPT ); Tue, 18 Jul 2023 16:50:26 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8EBD8BD for ; Tue, 18 Jul 2023 13:50:25 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 1769260C26 for ; Tue, 18 Jul 2023 20:50:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C48B2C433C8; Tue, 18 Jul 2023 20:50:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1689713424; bh=jsjxHYDmiK3p+nOT5h02WYi1N3MzrRVdd2+TaPsAMcY=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=Ov7F4c874drS+8VG1uVw0WB825cVnx7bjr0+UgPYnPVq0LZ+TAxjfn54bGtVweBYM u2YrIDq119CAI1Wx5fuuNT7DcN6DRo2wFYKJLgP0Qvuc6fsr2Sxq3z3ZhIgbtshbBe MIMnHC32Q+Bn48Fs5GAjCFKTMUo+Sj2akZKBnH3dtv+k4lvuh80vDd1PzqosEmCxn2 TA3ScaWNq+Z9yLzicwUVqShZog2zbOWfAtqXvqURDHijmEieucXjc8bw54xRjE3vTU ZG47TGAi5JUTwSANwj1XH//mExHZD9dbguZ1Ex/6NoAm4aIk5RF+ax8T7V53iqP17C Ct8qkkGMZJhlQ== From: Eric Van Hensbergen Date: Tue, 18 Jul 2023 20:50:17 +0000 Subject: [PATCH v2 3/4] fs/9p: fix type mismatch in file cache mode helper MIME-Version: 1.0 Message-Id: <20230716-fixes-overly-restrictive-mmap-v2-3-147d6b93f699@kernel.org> References: <20230716-fixes-overly-restrictive-mmap-v2-0-147d6b93f699@kernel.org> In-Reply-To: <20230716-fixes-overly-restrictive-mmap-v2-0-147d6b93f699@kernel.org> To: Latchesar Ionkov , Dominique Martinet , Christian Schoenebeck Cc: v9fs@lists.linux.dev, linux-kernel@vger.kernel.org, kernel@pengutronix.de, Robert Schwebel , Eric Van Hensbergen X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=955; i=ericvh@kernel.org; h=from:subject:message-id; bh=jsjxHYDmiK3p+nOT5h02WYi1N3MzrRVdd2+TaPsAMcY=; b=owEBbQKS/ZANAwAKAYj/1ftKX/+YAcsmYgBktvsMuhuT2Ny13fKIEogkB4iNxaw3dU7ivO5zu pvtCeoh8q6JAjMEAAEKAB0WIQSWlvDRlqWQmKTK0VGI/9X7Sl//mAUCZLb7DAAKCRCI/9X7Sl// mGwgD/oCnQ6KwfSKR/K/Jq68YlKph1hzVl4u1NQzSg9tvezTVWnVsYjTxyJU60aVg1GWJGzrl70 tmG4LIN6ec9XRxP4dEDBP4FavHOiKnGnzZ2aXwOT2wtNMgkhuMfM8W2FGANt2jHg5b/JMYeYLkw Eh7Xyt3xK8VJxyICuPDCgpt9h6L5DTgJBkIFAiajmGKzbPHV0RhsFUuULMoc67qz0S3pjNL4EEu oSkg8VCadfi2FUJBGlOl3TUZ/4w5qqo3F+SqaOjWYsKu0wMeAkTNmRND0VQIirOQNWcCj3cDPET RltSMBJxX3Vw+IKE7YfMXJrY8CLG52YemdY//LKQ2x6KHAMXkuonOa9kRM8PFEshsXikCEqR0Y0 yypSLlwINnEfrEiCkWUE4grAkovh4iwjoAvTdgijuQ5MrQP/JbIvX9bPzHIpbFTiKp4unhUcIzS Llbh2a1gOv21VKk5P9qNJKfgXn9mt9sPOjubgkYtnS4HEqf4INgyAKq9Oeu4hckapKrEIvnHWWh lxPYPqvzyegZycncMyIEGhsEJ0LOSX/1a2AtLo/47B2JNkR69UUMFbNr/9iJT10iK9Wt78Ami4C S32DO1ef3Xa0VN9cDT1jTosBoBHZIu2DULwUoz4r55S+7ylGHjAa21Qec3w72qetDf5AUf1896x FXwVyE4dpalAD1A== X-Developer-Key: i=ericvh@kernel.org; a=openpgp; fpr=9696F0D196A59098A4CAD15188FFD5FB4A5FFF98 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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: INBOX X-GMAIL-THRID: 1771794768381206219 X-GMAIL-MSGID: 1771794768381206219 There were two flags (s_flags and s_cache) which had incorrect signed type in the parameters of the file cache mode helper function. Reviewed-by: Dominique Martinet Signed-off-by: Eric Van Hensbergen --- fs/9p/fid.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/9p/fid.h b/fs/9p/fid.h index 297c2c377e3dd..29281b7c38870 100644 --- a/fs/9p/fid.h +++ b/fs/9p/fid.h @@ -46,8 +46,8 @@ static inline struct p9_fid *v9fs_fid_clone(struct dentry *dentry) * NOTE: these are set after open so only reflect 9p client not * underlying file system on server. */ -static inline void v9fs_fid_add_modes(struct p9_fid *fid, int s_flags, - int s_cache, unsigned int f_flags) +static inline void v9fs_fid_add_modes(struct p9_fid *fid, unsigned int s_flags, + unsigned int s_cache, unsigned int f_flags) { if (fid->qid.type != P9_QTFILE) return; From patchwork Tue Jul 18 20:50:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Van Hensbergen X-Patchwork-Id: 122241 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c923:0:b0:3e4:2afc:c1 with SMTP id j3csp2018527vqt; Tue, 18 Jul 2023 14:26:14 -0700 (PDT) X-Google-Smtp-Source: APBJJlGgst2CgU9ImLNivEEuHlFzROjJ/oNUTQkh806GnSp2PbBly0pj9O+FR/mBG7FCP5WUPh/B X-Received: by 2002:aa7:d805:0:b0:51d:b89d:9818 with SMTP id v5-20020aa7d805000000b0051db89d9818mr817405edq.12.1689715574570; Tue, 18 Jul 2023 14:26:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689715574; cv=none; d=google.com; s=arc-20160816; b=GerQTe1+cqMJe/J6/Nt8i/iOv17MAMFQA/lWpc7LgViklifSq+LNlQ9GM5TRvVqXQP CPRWbC6i5X8IQL8zJB6C1B84dNXEhJRXIggSbYmKZ5QQk9GwiSeY0MAX/eJvoRUjR3Pp jtT2HVGYxVWsukqzNSqf2z+hMwJ1oID/jVFEqo8R3hd9sXT+iLACNbDI+4oM2+2a8amr BcUwwNAciEfD5bgD7HkLHXv+IK8TzNIfBulPkEuqKWF0KntbMP3+bGxCF4WNb5Kd2c3m uInuRWJAM8CYu9ZPgLb7HRBctosGYLjV72QSE6gWsktMFqoHoSt2J+DOQLZ4itBN011s y4Nw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=MRtIjLAEPTsIshmeCdj4+weqhzxCEUplfltP22NpV4Y=; fh=j3YVng1RRZ6+ldvc9lS8NG/D3Vm7wGIMCbG7LdLsfsQ=; b=DauOW4ciq0LpYeySc5SLekZRUMq67EvBPF8BbBi5Z1G79JaM1Lro9PNH4LcavWfo9A 69od8qzWbxf6neahO/o3yKnLiOSaK9NU5xwPRaMT2TzM/6jH9zGYZGp3UJXlvzC2pbYb TxvOzDp18NqLUYf5fMGHyBoMZ00A0RgsHboVibMcQraTGqtR24FUteyJDY73wTOguEO3 QqVsDQQTLSn6gLi+R2nYY3Ue6Oc4SbdnNEjNvPO6gzfbCJVUh+lQVAcfYDg7vAA/qqLl MgA/ur+P3LKQ8WyCNimUl5mGw6dF1MkclvcjyEglu6R/oeGmLrJFXAOENsJhridPBeSY 5JPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=gQLfe2sZ; 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=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w1-20020a50fa81000000b0051df1fef473si1800175edr.549.2023.07.18.14.25.50; Tue, 18 Jul 2023 14:26:14 -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=@kernel.org header.s=k20201202 header.b=gQLfe2sZ; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230519AbjGRUug (ORCPT + 99 others); Tue, 18 Jul 2023 16:50:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52578 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230320AbjGRUu1 (ORCPT ); Tue, 18 Jul 2023 16:50:27 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 82D07C0 for ; Tue, 18 Jul 2023 13:50:26 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 21C3D60F7F for ; Tue, 18 Jul 2023 20:50:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BEACFC433CB; Tue, 18 Jul 2023 20:50:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1689713425; bh=scxEmsmSS3yAw8Pb9vs+lLcPVOwcbwDaNQFx5fsoDzg=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=gQLfe2sZU78/8tGyOQjHfsxtD3oQUv+Px5p2nKSG2zOFChi/ssTKr3JBCzye1qq+8 7VNbb0lJBrjlbHvzinxbFVOanGpdbgiFHSIpmwpcfz6sOowDLYcJFdexcC5UZQl2rc SIWcIec7RA+pcZhOZbMmxW1u/MvG+Q55kF3HcCJ4d2fWg+ORaLXnpXhqrJATV5Jpvc KfFkXep5yxpZYkcOYus1diAFXr7sFso2FEF81FqQIm89o1eGkiPbDOy+41kVGnGr5w peJolAYeeC7dwcwWHCBKcGrmv9x7qJfarLKKD29P63QWodHBhllrC+vUff5TJ5SVm8 HgB8WgpmNxWwg== From: Eric Van Hensbergen Date: Tue, 18 Jul 2023 20:50:18 +0000 Subject: [PATCH v2 4/4] fs/9p: remove unnecessary invalidate_inode_pages2 MIME-Version: 1.0 Message-Id: <20230716-fixes-overly-restrictive-mmap-v2-4-147d6b93f699@kernel.org> References: <20230716-fixes-overly-restrictive-mmap-v2-0-147d6b93f699@kernel.org> In-Reply-To: <20230716-fixes-overly-restrictive-mmap-v2-0-147d6b93f699@kernel.org> To: Latchesar Ionkov , Dominique Martinet , Christian Schoenebeck Cc: v9fs@lists.linux.dev, linux-kernel@vger.kernel.org, kernel@pengutronix.de, Robert Schwebel , Eric Van Hensbergen X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=634; i=ericvh@kernel.org; h=from:subject:message-id; bh=scxEmsmSS3yAw8Pb9vs+lLcPVOwcbwDaNQFx5fsoDzg=; b=owEBbQKS/ZANAwAKAYj/1ftKX/+YAcsmYgBktvsM6EaD3uQIChje/362palMFSayDgR3qaOWO dsMdF9cc6qJAjMEAAEKAB0WIQSWlvDRlqWQmKTK0VGI/9X7Sl//mAUCZLb7DAAKCRCI/9X7Sl// mLrFEACWjUV9pX/ivEzfBsAWNxyETtVIY4AVufEY6ephLHNpEIegrcmzupnJ+Jz7uFRLdTLMF7c 9GQPcjG9oq8tu7JxTsvRJd5dRRDunPi+caDam+5BmpVMVJ4JjJEoTyX/EwSylM7BX8zGcYtgcBc BOYOTznWqLKc7O6QGewfAl19EbsbZL8d6EFAo19p/LEo7sMR1Jy0u4c0/9gPniZ+3HDMZtz3Hs0 SXLwNi9gr06sAlxc2jBFyy7cgSbXWHzD/+Wp4WWsIqeL7h7jUHKfH6WYmsIbYi2fPMejghZeNsI IDyxbaHm4jSNYnLulLDuTK7JeO/03t1zyZryLh4UfVBeYSXSotY9HycOXQWjDGue0ScZddviXU4 hxV9+wq5j6Zn2AIpej8C07r5xQ1oNAYRG7xtmbETUYSDUQP+D5fTJHI4JWnZCbRZriNzbgW0TyF d6sh9ARoaoyUNabFuzxwobOkuS9w78MPfA7WNOfje2aGsul9v4YT497597CijRYqnRsnudf8Wsg ay0c2ME8h8RatfPVZV1GtmqrOTDf5ZzQdforHXTSl99X9VzlunbiDn3dJa50gVc27bOuQ7w6eHi m8jBvuxPu6Sb7gDTRshrje4uv32/pYL+0vwN17BLFnq6bYlMSmKqW2ejcx5MNQouF33jBJaX18e hUNzK/SW/afmSsg== X-Developer-Key: i=ericvh@kernel.org; a=openpgp; fpr=9696F0D196A59098A4CAD15188FFD5FB4A5FFF98 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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: INBOX X-GMAIL-THRID: 1771795198324174378 X-GMAIL-MSGID: 1771795198324174378 There was an invalidate_inode_pages2 added to mmap that is unnecessary. Signed-off-by: Eric Van Hensbergen Reviewed-by: Christian Schoenebeck --- fs/9p/vfs_file.c | 1 - 1 file changed, 1 deletion(-) diff --git a/fs/9p/vfs_file.c b/fs/9p/vfs_file.c index bda3abd6646b8..3809f3a531499 100644 --- a/fs/9p/vfs_file.c +++ b/fs/9p/vfs_file.c @@ -506,7 +506,6 @@ v9fs_file_mmap(struct file *filp, struct vm_area_struct *vma) if (!(v9ses->cache & CACHE_WRITEBACK)) { p9_debug(P9_DEBUG_CACHE, "(no mmap mode)"); - invalidate_inode_pages2(filp->f_mapping); return generic_file_readonly_mmap(filp, vma); }