From patchwork Wed Jul 19 16:22:30 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: 122734 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c923:0:b0:3e4:2afc:c1 with SMTP id j3csp2572547vqt; Wed, 19 Jul 2023 09:54:56 -0700 (PDT) X-Google-Smtp-Source: APBJJlEuEuhdz4oxiocrW7hVjYtssZBf8fqQ1mSotRrFoPset5DepKx5qiBpF0pPE4cV9ohCCWmx X-Received: by 2002:a05:6402:287:b0:51e:2921:28b with SMTP id l7-20020a056402028700b0051e2921028bmr2641018edv.21.1689785696155; Wed, 19 Jul 2023 09:54:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689785696; cv=none; d=google.com; s=arc-20160816; b=vBQQM+qbhpE3e/WPMvksouMiNEwaDaRE30aTWpK786uKMdcv2YHOT6CAVLh3eqWyFw NvaqrJ2SSDoiTjLWZK2IriHbgcF38+Km6aoAL7jPyzlCAB7EdJ8QyufmPGq9DTj8wcyy gTWgmvNkRc9NolK0qenZil/cCkEYdKVW0N/k3gk41a7w69M+Ir8f0Bf2pFd++G3NMlvV Mp4zbbAF6VM0HTlY3JNV2lfvTPrksCp9onB72vecqbnsQWlq+X55azBiyG8p/ho4CwDA JELwjg7mWGNfGDH/3/PcfJYmt2Bi0ksLcQxZt6nkBva6F2vaQX72xvpnjdkieSAE3rIq qlGg== 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=gk6vVjbJfaMFNZ7ukY+zTZ+cpwFQfFGszbgkKAYp4OY=; fh=deCyYo6QkFncNtSlW+COYKWV+QHrPm0qFhnqufnpqmk=; b=c5BnQGnjwAjF9DkdueTbOtVzGmqVwp55SA75fip76RKYx8Fi6y2kH89k/mhQ1AIj9x CwHZA6lrJjUFc7U5UVvtJR/YNAcKHAZECqABkqJyBOVROxQLf6KG4rKQW0rPSuH00x93 IpbnRQ68cT/lVdSa5T9KX6gr8xf0RA37GDUZNgF35Lv2K6PW9hk4WRG7OeG4jeEUncoQ SwQC5kc9nUtAreQbO/jtKg91Ou0LCbfrAt1dbJNy4Tax6+rrYdq/nK6lkbvQRxZmLgqU 89y9o3PwZcFN0NfhYykgRuc0G1Se2BH1n7dGlQP3/LbWJG7+P4LOoj3xUdWPR6nwTx29 y47A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="qZv8/kh4"; 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 o16-20020a056402039000b0051e19bf66a6si3193850edv.62.2023.07.19.09.54.30; Wed, 19 Jul 2023 09:54:56 -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="qZv8/kh4"; 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 S229736AbjGSQXC (ORCPT + 99 others); Wed, 19 Jul 2023 12:23:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45210 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229749AbjGSQWx (ORCPT ); Wed, 19 Jul 2023 12:22:53 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A0D401734; Wed, 19 Jul 2023 09:22:52 -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 335C261788; Wed, 19 Jul 2023 16:22:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6FB56C433CA; Wed, 19 Jul 2023 16:22:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1689783771; bh=K6oAnsvQEIZrftCXh7mBn5FA+pVc8rhUAGklED1yUHw=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=qZv8/kh4Iyuuiswu7oyZwUcv4dJT5RoNFpwxVuluWlCwCWmretLUk5PaKDIhLDoBR j902l4VPO1zqp8LwQm0lCqOiPKrAzD88mBt8H/3HsjOnXfwPOau7uGUwOyJXJ8FPdH ErbPXrOPlV3q/wjdLlC68hlxxNlKjHjaHuHdJGCEUdjAuaQLrbjH9N6CNqITucpcgE K6EzBQV/GhH1UsrcxCeyAw1jTqSI8O3eV4OCzu6HqKyPXYvyr1A/UqiPIwIdudQaTJ yLmvBN2oR94w8cW7zvq7I4rlg311Ez1B4W3U4Fkv3lOhC6fnGPce7rWM0hkRTyEwDO is0D+7MER80lg== From: Eric Van Hensbergen Date: Wed, 19 Jul 2023 16:22:30 +0000 Subject: [PATCH v4 1/4] fs/9p: remove unnecessary and overrestrictive check MIME-Version: 1.0 Message-Id: <20230716-fixes-overly-restrictive-mmap-v4-1-a3cd1cd32af2@kernel.org> References: <20230716-fixes-overly-restrictive-mmap-v4-0-a3cd1cd32af2@kernel.org> In-Reply-To: <20230716-fixes-overly-restrictive-mmap-v4-0-a3cd1cd32af2@kernel.org> To: Latchesar Ionkov , Dominique Martinet , Christian Schoenebeck Cc: v9fs@lists.linux.dev, linux-kernel@vger.kernel.org, kernel@pengutronix.de, stable@vger.kernel.org, Robert Schwebel , Eric Van Hensbergen X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1223; i=ericvh@kernel.org; h=from:subject:message-id; bh=K6oAnsvQEIZrftCXh7mBn5FA+pVc8rhUAGklED1yUHw=; b=owEBbQKS/ZANAwAKAYj/1ftKX/+YAcsmYgBkuA3YMIjmuoMKqeY2BsmWo6nZ5varMUeKrXq1A ZgW9vAkk0SJAjMEAAEKAB0WIQSWlvDRlqWQmKTK0VGI/9X7Sl//mAUCZLgN2AAKCRCI/9X7Sl// mLVmD/0YVO3O0CHQoWPMnoGtCl1BrCJgi4NkTHU1J4rP0H9hKOJ8OUaephCEQ1KU3WZzKEKMK/b uYtwMcqyqd+PX70SbCMFlQhZxsiiNOvDtUpaOVC89rTozUMorggCYvVr95NmQ80HlViSHCadvIX K4i1W+sMcga84ViNqDgt+mFn0urJ6z44hs6skVwcIDDImceU9lunAM2BejqtK3w0AFkMXEzqnOX SdMeV03rF6zVFwK7/7xACx+dx0MJVlC/UP6o7KLTTkoU0Nzr4hB4ZqaCy61b8vMqUln7lVRxZaZ jk0zwMV+5XN0KBN7eb6WtzDeURR97FOLTww1chVWjIaO2W8mNc4z16eSuDHMTk7ZlxkTM6avVSv Kqb7YDf5brbCHsuQb/FjwBM1Fq44newsqNlWNVbSIhrRczmt4xD1eRU+B6mfr59IvMOcW5jPEiR kzuQevXCHkBmxgMLUXg0cLPCSr8non0kUbz1NQAkU6Ba5mLopt8keYqdr7DeH2blqkUKdRfLp6q BHaw4Yjh+y/g62WWlkuHNOfSngAdz4T8tse1IQVoKMbsUiXt9Iof6lBMRPhCLnIGoF/K3pIcLDc +mdwaVFmkNp3LYDpIzCwjgUoIYp2gGOZLJsVW0/izToqd0mxVBlXPYXrOgb+ANu0prCENGMgOZ2 gwFRnjJFnsjC0zw== 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: 1771868725993081460 X-GMAIL-MSGID: 1771868725993081460 This eliminates a check for shared that was overrestrictive and prevented read-only mmaps when writeback caches weren't enabled. Cc: stable@vger.kernel.org Fixes: 1543b4c5071c ("fs/9p: remove writeback fid and fix per-file modes") Reported-by: Robert Schwebel Closes: https://lore.kernel.org/v9fs/ZK25XZ%2BGpR3KHIB%2F@pengutronix.de Reviewed-by: Dominique Martinet Reviewed-by: Christian Schoenebeck Signed-off-by: Eric Van Hensbergen --- fs/9p/vfs_file.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/fs/9p/vfs_file.c b/fs/9p/vfs_file.c index 2996fb00387f..9b61b480a9b0 100644 --- a/fs/9p/vfs_file.c +++ b/fs/9p/vfs_file.c @@ -505,9 +505,7 @@ v9fs_file_mmap(struct file *filp, struct vm_area_struct *vma) p9_debug(P9_DEBUG_MMAP, "filp :%p\n", filp); if (!(v9ses->cache & CACHE_WRITEBACK)) { - p9_debug(P9_DEBUG_CACHE, "(no mmap mode)"); - if (vma->vm_flags & VM_MAYSHARE) - return -ENODEV; + p9_debug(P9_DEBUG_CACHE, "(read-only mmap mode)"); invalidate_inode_pages2(filp->f_mapping); return generic_file_readonly_mmap(filp, vma); } From patchwork Wed Jul 19 16:22:31 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: 122714 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c923:0:b0:3e4:2afc:c1 with SMTP id j3csp2562615vqt; Wed, 19 Jul 2023 09:36:56 -0700 (PDT) X-Google-Smtp-Source: APBJJlHOE6qed3vwYUV9Vlob8ghE4HB+5GLASIcBQwUE92gZzqE/tCwhndJLGdIa1ueLlyahnw5x X-Received: by 2002:a05:6402:3453:b0:521:8d64:df1c with SMTP id l19-20020a056402345300b005218d64df1cmr2988470edc.0.1689784615786; Wed, 19 Jul 2023 09:36:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689784615; cv=none; d=google.com; s=arc-20160816; b=0jn/sudYZLHp0nW42lYtQebbcbJaVwV5mXWiult4Gj4weQyNFXopYlxAg6QJcJkHJm L1EvNIRp3cS8tAQoccfFjN9McrkjVlF8nyFAINCgB45QKurS2gXYwLg+Cad5XYlM4kIs vDgQC9AEZvau4sDAK9h/JhNCqqnG2gfJ1gu9+HnkaecFqX5ax+ODhyq3xpd6Wuijt9g6 +1n9SzG7LrIAylu3F+BSo1l4fNnH+wioYhMZBTSZ79JmoT5LvTp9b+WlV0RtvHi5skSJ qFx4HJgWrn6ivzIDVDwYfQ8LsP52HzQN78SMXx+sRdBlFOhhFlkW0KbpaUBSFrSczDU8 SHZQ== 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=5bATn22nB9SIjn18e0FsvZAmqFTVVLHXYWt8LHuLIK0=; fh=deCyYo6QkFncNtSlW+COYKWV+QHrPm0qFhnqufnpqmk=; b=tRl5DXyuVYDuwm5kDn9CgldM+nJGG4sNAdbZ9nep7Jd3169TDKsXvjMrsroRNmMo/O A3gS/zoLiRAmjg67PFVN0yI1n1wjYcVmYKQ89qlQKpyQ2tFgtf18cLKiyTh2b1ZL5ZOC jIgWeFKQtTlPWDI97XsuIuD6S8ce3cJZOzZy1iZ0KLcc6QoDJH1t+48CG7OZpKon8fqp n0VD2kFdOTnzxgj75gBN4exMuUC/Z3pLsUBeNcGjmo0qXsH6EmY/e/OEmWT45BEbz4sU BS5/fRvt1OjiZvYw+eRbhdhpnl/sMWXoaKrOt4YdSQoqpwV4L6R04hP/cz9RVz76fXIY b40w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Ybo+jM3V; 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 i26-20020a50fc1a000000b005218bb04994si3117826edr.624.2023.07.19.09.36.31; Wed, 19 Jul 2023 09:36: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=Ybo+jM3V; 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 S229884AbjGSQXG (ORCPT + 99 others); Wed, 19 Jul 2023 12:23:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45222 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229874AbjGSQWz (ORCPT ); Wed, 19 Jul 2023 12:22:55 -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 57BBD18D; Wed, 19 Jul 2023 09:22:53 -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 6E2DC61784; Wed, 19 Jul 2023 16:22:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A2FD3C433CB; Wed, 19 Jul 2023 16:22:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1689783772; bh=MhQlJrTsZHmha2KJIBaaG75cljAu9xtlF2pUFmjLQl0=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=Ybo+jM3VJ9XHhauSCwdIsqdzWeqFQzs/qxba1+/HJ7MFo1coteRMEFtDOAJVonupb x5V9PtV/MBliY+teolKzToutb94UNyG0gFL+uw5WgWyv6xZ0rvKER6mZqbUaNQAKW6 p3XcOg8yabNhSB+ci6Msr+j6Jjhnh10f5Z31/itKq3Xdhl+MnJvTn10G4OP/uoLmqW UmwS5f8GF3xEwCLE0e5qxLKHeCRGxP7uPke3mN4GBt+JsOozSU4k1SQ8SJlC5mUOCz OpHzfdrcrcOqD9Uf6F1e9iX43wj6y5XEnUylH3Ftmea7HdfzxnfhE5GR0ElQ/qrFrX ivJTQunK94Uww== From: Eric Van Hensbergen Date: Wed, 19 Jul 2023 16:22:31 +0000 Subject: [PATCH v4 2/4] fs/9p: fix typo in comparison logic for cache mode MIME-Version: 1.0 Message-Id: <20230716-fixes-overly-restrictive-mmap-v4-2-a3cd1cd32af2@kernel.org> References: <20230716-fixes-overly-restrictive-mmap-v4-0-a3cd1cd32af2@kernel.org> In-Reply-To: <20230716-fixes-overly-restrictive-mmap-v4-0-a3cd1cd32af2@kernel.org> To: Latchesar Ionkov , Dominique Martinet , Christian Schoenebeck Cc: v9fs@lists.linux.dev, linux-kernel@vger.kernel.org, kernel@pengutronix.de, stable@vger.kernel.org, Robert Schwebel , Eric Van Hensbergen X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1023; i=ericvh@kernel.org; h=from:subject:message-id; bh=MhQlJrTsZHmha2KJIBaaG75cljAu9xtlF2pUFmjLQl0=; b=owEBbQKS/ZANAwAKAYj/1ftKX/+YAcsmYgBkuA3YG2lCTw7UKGBhazSWgJkV4G2nM6ldEheUr xyRiO0BqDCJAjMEAAEKAB0WIQSWlvDRlqWQmKTK0VGI/9X7Sl//mAUCZLgN2AAKCRCI/9X7Sl// mKzwEACfb3WBpP4t95Qby/jwVvjdngxQWel1ZL9JHoeb1r1FKF+FybflItJj4JCmqeAcOc9/Vh8 xsP8vcee8Wjp2XQ5Z0NEUNX0Rp9taMXvUxKsVkjTrzmpjeRlM8+7dBnZzGWJ3PBGpMEpu0urFJv jIk7515+CoKprBoITqKEORaMcdOSitNRxUhGFZ82XC31fzbdH8ehG+KJ9lLqpNqUd9prTQX6YTr 5lVAhp7ClbOkxH9aefpNBmpWeS0mfTp5FLE4ysrjUANkzqm9biqagH2i79dm/IyY0qEC29BUG9Q hXKuT0RUiNFCX4lB9RLie3dT4217w65D0FcQ18agAEm9pP4nmHoNAB5gtvvQzE6mBYM2rQuZ5WZ lC6z32z+OB5Cb+Qo93fG8lUMPv1egOGP5IqTgHkmqud/RHpLXWHqztbAxB0TnNsXfK81Jj3Hc/v 4IRUtqhBgIoOEPxQQQC7AkJ5TrQUTRvmKJYC3J+RHjd91bd065inBCqd3b9rSaQN7KOcPzMgxcD uLasiATDItiixE4D0Q9Hrq8xCNWdEYbBATcji3CaKbwnT0eKDcOORD1FUOLOPlEdGs56nSC+nHM bVTwsjiIKX5tkQqXnPBchUlUcpLhOm3HKzoQ8s2flq2wWHkuMHedzeT6zH5qURqbQwqCOU0mbEP Pn82PdTDe8cLk3w== 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: 1771867593148660496 X-GMAIL-MSGID: 1771867593148660496 There appears to be a typo in the comparison statement for the logic which sets a file's cache mode based on mount flags. Cc: stable@vger.kernel.org Fixes: 1543b4c5071c ("fs/9p: remove writeback fid and fix per-file modes") 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 0c51889a60b3..297c2c377e3d 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 Wed Jul 19 16:22:32 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: 122732 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c923:0:b0:3e4:2afc:c1 with SMTP id j3csp2569827vqt; Wed, 19 Jul 2023 09:49:51 -0700 (PDT) X-Google-Smtp-Source: APBJJlFxNbo0DI6irdQXEYgXM+wktt034z1NH34PSWbh2mWmP2PlKTZBF27bLZymcY35Gt4CzQzL X-Received: by 2002:a05:6402:1b19:b0:51e:253e:1e0c with SMTP id by25-20020a0564021b1900b0051e253e1e0cmr3009450edb.25.1689785391010; Wed, 19 Jul 2023 09:49:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689785390; cv=none; d=google.com; s=arc-20160816; b=yPTMeo0PklrD9N9X+ZWtTNCiD7Rph5PELXJzyPdQ+Q7hUzYYWjLHW2PZwWmC3YKd7J Dw8qout/pt46cG+Oc2M/BI3rLMrevsBsE+zEioGGk8KGIdCaPoBUQtrp7Yf5rBM7rMnl p727gR2gv8b0xetjaUTkJ3hOUQlPvao3MkhhJEbCYcNG//DRXSHgsA0FWCBpmgsVvOOY iF2ZefCaWwppiBvm7axk2oVYsP+vPGSyKwuR3CKAxYFKX05Kpk0fXYB1S48pFF+Zv890 kZYa52EkcjuSY/vaw877I484KJzD3AM9tfaK02reCcbsYDwgVMV0uTrqQBwk3Ilh0A90 iSJQ== 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=5vDCK1dpoqYcHRzXcYsI7SLvOCDA1CsMh8QAhuhFTjM=; fh=deCyYo6QkFncNtSlW+COYKWV+QHrPm0qFhnqufnpqmk=; b=J9uivfR2qZVtXTWsE93gzBSI93p53pJ9ALn+wH7MzmsQeapQBPkhpFqxtNy050YeHe Bel7qIz91YU3wg4l7ibydEGGBkMezvohrRDFrztZPDYyyyo4TPEYvTPUI9Zs3VRLFtr/ oL0EZTxTC1nCxH3gYuNTkp3WNdsCsRJn9GcrIkTRs2rxTdEpkRWVyI/+W8aK6J1+W3nm U5RFpZhv+9GayDb2mW7rXATEXhsf5xi7rxWlPuKcK7RaOt0nTzU6ZWKCtTqtYj6e1quY jIfROnUJOaokWsgm7sxaewtX3fzdQUkRbAZBrVSM7a94XxU7IOKiEYH1D74v5rpTRP4N +3VQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=tEvY4snm; 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 e6-20020a50ec86000000b0052166e59367si3311071edr.330.2023.07.19.09.49.27; Wed, 19 Jul 2023 09:49:50 -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=tEvY4snm; 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 S229994AbjGSQXI (ORCPT + 99 others); Wed, 19 Jul 2023 12:23:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45234 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229919AbjGSQWz (ORCPT ); Wed, 19 Jul 2023 12:22:55 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 148ABB6; Wed, 19 Jul 2023 09:22:55 -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 9BBDE6178D; Wed, 19 Jul 2023 16:22:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DB223C433C8; Wed, 19 Jul 2023 16:22:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1689783773; bh=exSvQfCJy5HOJ0e35lnsgXGxg66VQJVaJEEUsXz/SvI=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=tEvY4snmwkL34r4FGAGuqjLcHEgVdTgJL7BkqvldfJSzOA0wVDMT+5i0gW3De3Na5 K2oUFM4Oqb8xENigBbUHzYaO+U1h3Qu9WNmeBlB6zxs9fR50bYv2ZUnx3nX8iFyBfl 7snwPG7CxmUdQGJ+xE1TB/G8khUX1sBcmapwjAeHRDcsb+GcPVUDmtXW1HXmEgeTjI JxkPjE3ewejr0p2GkZi9UY30xBfbfN+p0GH5UD6A8uTa36diZgBgXg6A4ALqYa4+GR GoJU4hXCW0kebZVKQsPFzFzVTeGClmyYf2aengwtHfGfdBREXM6xPq0yjK6uWRttVy MgEQ30L9oV3Mg== From: Eric Van Hensbergen Date: Wed, 19 Jul 2023 16:22:32 +0000 Subject: [PATCH v4 3/4] fs/9p: fix type mismatch in file cache mode helper MIME-Version: 1.0 Message-Id: <20230716-fixes-overly-restrictive-mmap-v4-3-a3cd1cd32af2@kernel.org> References: <20230716-fixes-overly-restrictive-mmap-v4-0-a3cd1cd32af2@kernel.org> In-Reply-To: <20230716-fixes-overly-restrictive-mmap-v4-0-a3cd1cd32af2@kernel.org> To: Latchesar Ionkov , Dominique Martinet , Christian Schoenebeck Cc: v9fs@lists.linux.dev, linux-kernel@vger.kernel.org, kernel@pengutronix.de, stable@vger.kernel.org, Robert Schwebel , Eric Van Hensbergen X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1057; i=ericvh@kernel.org; h=from:subject:message-id; bh=exSvQfCJy5HOJ0e35lnsgXGxg66VQJVaJEEUsXz/SvI=; b=owEBbQKS/ZANAwAKAYj/1ftKX/+YAcsmYgBkuA3Y9X0qfbFlJ6sfM0lCKgu7/mb+WN7TKAZPg xXIlSHSqv6JAjMEAAEKAB0WIQSWlvDRlqWQmKTK0VGI/9X7Sl//mAUCZLgN2AAKCRCI/9X7Sl// mEXNEACjLvXN3fAnnDDhgVTEQKwe5zl9FzLhrDKt0Rs8wPEJppkcw5W8lTGL8Z8pnnuW6iOsvb6 BsqipDh/ubGHfcTV/7vD4Pp4eOkgfKy8nRtaGo+RZoLbI+RayB+szhSwNap0Bh1DYjhn3OVChtz 8gK0ffqrN//hFCI6hwdJ5Og2FIfpfWTytO+HG0gPtqqz8hdsiG1ath8JO9hfR3E9DScd4F/LziW UabyqZdlx+VQDwrYTEc7uSuTD2VoOW82mPIHLeDrL/aLuGnAns/kp2R7gPLv6+DMu2qeEcvsjxQ FgdX43EPhZ/K6mVHuQH8YkpANJIiyDs3mK4l24nvFMc63XUe3vBL/RN4Trhyzw0Zqqjs9Oml07H 1Rt5eJcHiVLJWDTw2B9luZTcxGWQefU6bSr63GQcztF5YyH2IFaKont0zGQmor2OIQi694uDJTm Gq+jIfKhbqFL7WxlkJPycDt/z31pql1OkyUXnHfrhmNFP5IiMb2FY4f5y6ShO4xRRzl98ms1/vC udsil8mTAQcSoObpUg5PJfqIfskn/W7WehlqlPc0LD24bPG6grQkxr3jMIaP+mYnmKXGtzT0xSF nvvvBp8KIYprh2ZtuUiKFRaas6/TqFXNymBkEw3gv+sMBI/Bw6uyDgeuBR+sCFuXkGT0HjrgcKQ ez+Is1DC8PVMQow== 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: 1771868406189540669 X-GMAIL-MSGID: 1771868406189540669 There were two flags (s_flags and s_cache) which had incorrect signed type in the parameters of the file cache mode helper function. Cc: stable@vger.kernel.org Fixes: 1543b4c5071c ("fs/9p: remove writeback fid and fix per-file modes") 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 297c2c377e3d..29281b7c3887 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 Wed Jul 19 16:22:33 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: 122730 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c923:0:b0:3e4:2afc:c1 with SMTP id j3csp2569435vqt; Wed, 19 Jul 2023 09:49:11 -0700 (PDT) X-Google-Smtp-Source: APBJJlFDgsd/eUZrFNTuwJB2EOAAa6dCpsZ+tHIUOK7Pu2N4CHNSK9j/pASnj4tthSJCGRfNgMXZ X-Received: by 2002:a19:4f1d:0:b0:4fd:d517:fbcd with SMTP id d29-20020a194f1d000000b004fdd517fbcdmr300000lfb.6.1689785351356; Wed, 19 Jul 2023 09:49:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689785351; cv=none; d=google.com; s=arc-20160816; b=0NmpZmmz2bzV7J6DF6mqwdIaAGMMkmML6tcimfICGdzmsFdJ5DxHzPiyOckpdyMSdV oTJLiMP8Zh85OXoOe2oFhrSpy6iv+faVOG0aTgofnq/xa8Gkk/5w6VWJwYRHH6qzpm2s L5agHAJqXUc8Kke6gu08hwzOBVAME8vMgrvoghJ8Vk45kFh/ClVtzIdoIzpOWWZM/+2Y xGrtMyhxcz9jICOxFizCj1VQMrt4DyijRDFc1AOvyUM6Ah+ou1Av99jW40X1+53sbban iKm2ABQMSGxFrcd6FAhIFbQ7ve8EC5u7xWxiytNW9YoRDV9Zh6J1dMIpWzdNgvb76ozR YZrA== 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=R0xq7d83L03GxfPJbcsbilgznNNdG6UdhK8Mz56ZRuI=; fh=deCyYo6QkFncNtSlW+COYKWV+QHrPm0qFhnqufnpqmk=; b=v+ZMmPPRdWtn398fl4hhMLubSRh+pWPMZrl+q0I+2Hh8+UN4uT5gVvsX9pyGmTex4N LYELVayK2/zWJSG29opZQrHyXvALg5TACtH3LMWvE6NsWUWkmuyOmcoTNqvfjgg1kJU8 qEV8rVoAekLPqGFkbjSQHeRP4QB07aFIGznSlcQUoy5FnqsOdZ1A0uMofdqs+U538iUp /Rq3JnwvOPQ2OpLtei9yX3XmsrMSd7tPo1uGdr4nk86eYB0LajRMJc/DzxU8mCsfSqyl kemqOQytiPNRfQiCPkGWrHfjDYJ5SsL00gZTkMq8ubAa/H67UFbozkNv6QjZHBkD+jx7 o3ZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=T2LZDWcO; 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 x9-20020aa7d6c9000000b0051e4bd3e707si3226080edr.486.2023.07.19.09.48.47; Wed, 19 Jul 2023 09:49:11 -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=T2LZDWcO; 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 S230056AbjGSQXL (ORCPT + 99 others); Wed, 19 Jul 2023 12:23:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45242 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229990AbjGSQW4 (ORCPT ); Wed, 19 Jul 2023 12:22:56 -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 2B454B6; Wed, 19 Jul 2023 09:22:56 -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 AEB3361786; Wed, 19 Jul 2023 16:22:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 11562C433C7; Wed, 19 Jul 2023 16:22:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1689783775; bh=k0K6ocifQ0ciwTzxXH7M8DUDHsKfrzNua/KxUjjXkFA=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=T2LZDWcO5puV7VRCOsBgGotJisgKYwNNFQPAB/HDRTnd0Ladvgmjla4PWV4BzPlYt i5xnpx5OP7rCjVfadkGllgwQuwN/eKoDlsQBe22il4LQzHMWer1aApYyMMSLWl93nH ipkU+jYlLEzhSpmE5oJlURyvBuQEhyZpl47om/5yysQ7Smn3Qg6szrq4OY1rk6R1EV QNdrGIH+VXh0LsjbUaXTquUsLvNjePH8ah6azGRLt7xXZoIqNaXR0lBsG3js4uYk2S CLddkeUGPjnORTEJfT5D7Vsoy7rZaCAVSD6xKsOKY0hZtNWJtHMp3p4k1rOqqKOdt3 VtNvQayijlXaw== From: Eric Van Hensbergen Date: Wed, 19 Jul 2023 16:22:33 +0000 Subject: [PATCH v4 4/4] fs/9p: remove unnecessary invalidate_inode_pages2 MIME-Version: 1.0 Message-Id: <20230716-fixes-overly-restrictive-mmap-v4-4-a3cd1cd32af2@kernel.org> References: <20230716-fixes-overly-restrictive-mmap-v4-0-a3cd1cd32af2@kernel.org> In-Reply-To: <20230716-fixes-overly-restrictive-mmap-v4-0-a3cd1cd32af2@kernel.org> To: Latchesar Ionkov , Dominique Martinet , Christian Schoenebeck Cc: v9fs@lists.linux.dev, linux-kernel@vger.kernel.org, kernel@pengutronix.de, stable@vger.kernel.org, Robert Schwebel , Eric Van Hensbergen X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=894; i=ericvh@kernel.org; h=from:subject:message-id; bh=k0K6ocifQ0ciwTzxXH7M8DUDHsKfrzNua/KxUjjXkFA=; b=owEBbQKS/ZANAwAKAYj/1ftKX/+YAcsmYgBkuA3ZNyXqWHLoseJ3EWeJrogkDkPGJ82+WR+E+ 0fnABkiAwuJAjMEAAEKAB0WIQSWlvDRlqWQmKTK0VGI/9X7Sl//mAUCZLgN2QAKCRCI/9X7Sl// mH8ND/9VN84P0uGYO69TQEHK08nFdvfeZKbb3riQpl7CAFJtG+EtOYdws4XwZ8FUHomM1KMghDr dPYNggkxw5oDu+dtozFz92PR9eBD8Ip+DBFPoilAM/x4/Z1Uq2emVkldZYVIPu6ry/DxZ+Safne pWnMVYb1tK6e8gHgUL85BLi+r4koXFs7GZBtQzjGyiKGE5ruEPgc2/wRuf8z2lceXBVAwjdRvAa h2mvQ314jDebSO2w2eBREQvuy2BiylBEHvUHebN/agJpNSeh420tc9N/We9aiybdxflBv777gTq Wi3hytnPFjfErlzhhLs0wV1ZOw40DHbMSdlIfUpRg/6JcXmAZF7NEAjmysyMuf1+xtERKNjYFu9 T2K+G1lQc0oACO07LebKqrY+aOrAYco8FZ9lEiKcnUWGEACgYiJgMIHJso9CCHY9+BM006uCuOW nJyWFxuRMYyYVKOh5w9jeKn3xXbx+rgTv4Fyy6Issr0hfD5+vUIckGIX36kaf1FfbsETlkzKrZI F1wQGbO466Ji+hjUYC5NpG5IduYMELK2gD5DrPck47M1BbGYhlO0poXe2HY2vRA0yojTLF9D7kd qe/S3ODW3fInC1vZsOPDoPtqGpbkF8LuX/G46f/kXVzW0Njm5eExaauysApKAC40+8cztAVmmiL ylMKFr4wG2hvSEg== 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: 1771868364608913652 X-GMAIL-MSGID: 1771868364608913652 There was an invalidate_inode_pages2 added to readonly mmap path that is unnecessary since that path is only entered when writeback cache is disabled on mount. Cc: stable@vger.kernel.org Fixes: 1543b4c5071c ("fs/9p: remove writeback fid and fix per-file modes") Reviewed-by: Christian Schoenebeck Signed-off-by: Eric Van Hensbergen --- 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 9b61b480a9b0..11cd8d23f6f2 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, "(read-only mmap mode)"); - invalidate_inode_pages2(filp->f_mapping); return generic_file_readonly_mmap(filp, vma); }