Message ID | 20230716-fixes-overly-restrictive-mmap-v1-2-0683b283b932@kernel.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c923:0:b0:3e4:2afc:c1 with SMTP id j3csp1224486vqt; Mon, 17 Jul 2023 09:43:54 -0700 (PDT) X-Google-Smtp-Source: APBJJlH49n4Xg4QUFC8ksSvmk3KoBBSbOO/5rod2WPIFm831CI+bTVMyq4MRRbgOaiMcdZWcqMGb X-Received: by 2002:a05:6512:158b:b0:4fb:8359:e8c with SMTP id bp11-20020a056512158b00b004fb83590e8cmr9296528lfb.34.1689612233790; Mon, 17 Jul 2023 09:43:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689612233; cv=none; d=google.com; s=arc-20160816; b=ot7w33pD/oCRg6myjvcr0j8r/SVqFDKEzYbBf1yjNu7OLXN/0NGwDdt1usExnJMIdw J5Bwf14pK0GIMMOR9d3yZlLaT987sFaHoHaIkSFwBDPqRMTg+61rn6VPbBSEQO4h5+WT jJsNoKWC5UNMJqqpD1Q/O3akfYS92/Ek3trpYq3/xkoZLsodP5K77AgBqNgYzKep6iRm VpCnpOV69D82qpergd0jrWd7QeTIjm5rq2yKLE/89V7YyPYcO9ksiFaWpzCpJnWEIXOt hBcVm/S8VsgFslshNCwJou+tVdm4lSG0q6EZmCYCy+NjngQMlk5h7LAL0/EYqXDLVoZP /htw== 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=nGQfKGFaUGEu1lJEHr6bl6VRwinlubayySMhu+UeIBM=; fh=j3YVng1RRZ6+ldvc9lS8NG/D3Vm7wGIMCbG7LdLsfsQ=; b=tYSXrZoIKJH8ro6Cfe9LC59D56UV/qlJjy5tnPBVdhRDwDDRT5Z8tZ7CMv8BetlXO0 EeSLXpYj4tyDj3xGX7WVifCEbZDmle5I9d9uhYw//YiVbrj8W7uBgZfC+Qg1KqkgokNg bNGWRK8wOuTVJQQD20RvFUtSJin4GvkJKRSHjeyQJFADn5iJZnwu/vBdTjh1MipxdCTh fk3jNI8SoUu5nuKIjeh0hcgLLgvEnaIX1ecYMB4e9uqKcFKZ+v80XPny+foFRT5uNom8 xltfywkYldEaUILEXHM9ftaWA4S2938LnPL2Sx/BTpjoJACBOzvt0rryuPth/Y8roxmr 2ysg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Jbsob+5e; 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 j11-20020aa7ca4b000000b0051ddc36463dsi14349466edt.629.2023.07.17.09.43.29; Mon, 17 Jul 2023 09:43:53 -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=Jbsob+5e; 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 S231638AbjGQQ31 (ORCPT <rfc822;hadasmailinglist@gmail.com> + 99 others); Mon, 17 Jul 2023 12:29:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39302 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231752AbjGQQ3I (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 17 Jul 2023 12:29:08 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DCD14191 for <linux-kernel@vger.kernel.org>; Mon, 17 Jul 2023 09:29:07 -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 7A2DA6116F for <linux-kernel@vger.kernel.org>; Mon, 17 Jul 2023 16:29:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2BAE7C433CB; Mon, 17 Jul 2023 16:29:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1689611346; bh=J5f/y73gbpYzAPzzqE3aQSPO6NaFKpqMLlK+5QoR/ac=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=Jbsob+5eNtbIFKANOFOdj+SVGklOF2uuGBVENNkiCnH6O4NdsDh1SfnY0TFd4im4E 3geBuWgHoO0mRJ5BV/zvHzfnHBFK0wWd0Rhf5FrRn49iDiIvbTIpnw6Qiv0sgDavlV 3AJi5EJ+4BJVmhlUhVRPQ7MWLg9oMQkIQ2c5JmFyRVJ/SEfmuHViZl0YYIVc8Xehr7 ht1lBOOz6vtH9ZS7eagxjA82K9jzMb+7Bl5A+yxQcPlVr+Q41S/eVgyGUIMUv503Ob D5ZMMMB9oU8VhWC/l1z014kyx9NCc9OFC93JO5cA27UK9MY71Yw4PhTM2q2NuOcqgh 2X94XS0ev7iRA== From: Eric Van Hensbergen <ericvh@kernel.org> Date: Mon, 17 Jul 2023 16:29:01 +0000 Subject: [PATCH 2/3] fs/9p: fix typo in comparison logic for cache mode MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20230716-fixes-overly-restrictive-mmap-v1-2-0683b283b932@kernel.org> References: <20230716-fixes-overly-restrictive-mmap-v1-0-0683b283b932@kernel.org> In-Reply-To: <20230716-fixes-overly-restrictive-mmap-v1-0-0683b283b932@kernel.org> To: Latchesar Ionkov <lucho@ionkov.net>, Dominique Martinet <asmadeus@codewreck.org>, Christian Schoenebeck <linux_oss@crudebyte.com> Cc: v9fs@lists.linux.dev, linux-kernel@vger.kernel.org, kernel@pengutronix.de, Robert Schwebel <r.schwebel@pengutronix.de>, Eric Van Hensbergen <ericvh@kernel.org> X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=801; i=ericvh@kernel.org; h=from:subject:message-id; bh=J5f/y73gbpYzAPzzqE3aQSPO6NaFKpqMLlK+5QoR/ac=; b=owEBbQKS/ZANAwAKAYj/1ftKX/+YAcsmYgBktWxPBdEw2pHkHpJf4Xrs3jq2I1uQxbOZVPS9P 0SXZzDTniqJAjMEAAEKAB0WIQSWlvDRlqWQmKTK0VGI/9X7Sl//mAUCZLVsTwAKCRCI/9X7Sl// mDCRD/9ikTI1Hr1beF9eb5g7a/YtQi7qfsc5Y7ivQJ7Y1EVQc2SnXcCmMNcL1QMqqPS/Mi9GOmc Knfagji4/igxXJxzv5X/3QQfyTsAnHUeU66Lza2/bqXbStwdyrPMxOxd0/DkWjHPe+yEKhZZyTT gTFyUze61f5frLrmupDaHkqbum5R8zbpns4UmKMOxcHh40QGfMmwFCJa3lVate72qecFe0HZ2im ECX19Mv5XSRJ0CkQu/DyFFyFGGNNRE2Lb12vdoj4jN0Ve4CEsuxIdeLjuSscy/INnPFahg9KOMM Q/5NpaPq9VHrAqqgRMM6kqI+W3qzj9FlTg8BtWEeEvKZ48/owazDkYRzwJyT4u93INDREraNfw+ I/v4QvmgI52LHDB4Bg4Jx4KIMW6iuqD6MOPJJNBrlAayGwhhpWq/r+nSrqWhJQeSsH6/O2J9U7V WG3DDqqxeZHzUqJaZNqqNueStcIl4i3qT+T7hHpSREX8d/UYqzw9Pgzfq1EGMpsQ+Rxy+f0FJZd YF0EvBRrJyvNfxmcCnwb6KGMHn4ndXYaSSumXr9D7oOag+btXlwjfpYngzhyV7b0BFr72pG+wD2 Y/vSlcQNXpSEPh1463LeNfg8wEnXGipjJvuo2EhMYPHb3zy/0/Vtefp1y/P0DKgaF8yUOs7pucP KwXH+8uf62IF9yw== 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1771686837905305434 X-GMAIL-MSGID: 1771686837905305434 |
Series |
fs/9p: fix mmap regression
|
|
Commit Message
Eric Van Hensbergen
July 17, 2023, 4:29 p.m. UTC
There appears to be a typo in the comparison statement for the logic
which sets a file's cache mode based on mount flags.
Signed-off-by: Eric Van Hensbergen <ericvh@kernel.org>
---
fs/9p/fid.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
Eric Van Hensbergen wrote on Mon, Jul 17, 2023 at 04:29:01PM +0000: > There appears to be a typo in the comparison statement for the logic > which sets a file's cache mode based on mount flags. Shouldn't break anything, but good fix nevertheless, thanks! Reviewed-by: Dominique Martinet <asmadeus@codewreck.org> > > Signed-off-by: Eric Van Hensbergen <ericvh@kernel.org> > --- > 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; > } > } >
On Tuesday, July 18, 2023 4:48:53 AM CEST Dominique Martinet wrote: > Eric Van Hensbergen wrote on Mon, Jul 17, 2023 at 04:29:01PM +0000: > > There appears to be a typo in the comparison statement for the logic > > which sets a file's cache mode based on mount flags. > > Shouldn't break anything, but good fix nevertheless, thanks! > > Reviewed-by: Dominique Martinet <asmadeus@codewreck.org> Right, at least AFAICS I would not expect any visible behaviour change by this patch at all. So this patch is probably just a formal fix. BTW there are a bunch of unnecessary braces in this function: (!s_cache) -> !s_cache (fid->qid.version == 0) -> fid->qid.version == 0 (!(s_cache & CACHE_WRITEBACK)) -> !(s_cache & CACHE_WRITEBACK) These could be wiped in a separate patch as well. Anyway ... Reviewed-by: Christian Schoenebeck <linux_oss@crudebyte.com> > > > > Signed-off-by: Eric Van Hensbergen <ericvh@kernel.org> > > --- > > 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; > > } > > } > > > >
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; } }