From patchwork Wed Jul 19 15:17:05 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: 122688 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c923:0:b0:3e4:2afc:c1 with SMTP id j3csp2519716vqt; Wed, 19 Jul 2023 08:32:10 -0700 (PDT) X-Google-Smtp-Source: APBJJlHzVGrLn5NDaMWzFIO/xhneFQzwCvWrHv88bu6M507ieMKVz5MIz8c9DoQMxtcluTOc22u6 X-Received: by 2002:a05:6a20:a10b:b0:132:7fb3:3325 with SMTP id q11-20020a056a20a10b00b001327fb33325mr18227612pzk.59.1689780730509; Wed, 19 Jul 2023 08:32:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689780730; cv=none; d=google.com; s=arc-20160816; b=btTiQKdnrzkoqyp3f2dGHoVv5NMbRDd3MEvqjmoGI4aBFEKjazs90AuU7dyQdRdIXZ hvrLaxvD83mR5yCvhPmyyCeiyyeXDcMOskveWjOYI30L+MAvldZm/g1p8I8nC3qnbePq pGtgJ5xT7b1gmGXwMsTTfBpWC5WFQmfTnc4O/zJgcfWjrgeUAg0pHr8gT6zBtiJrK7Li jvA0p8sfUfbUZrtQCOhWd06Ens4qElxOJz+M2OFLXhYOXKCwPiw4nAFEfkB4cCxv9BUk SClcarGLDp/e75usmniIYzLIW2n/TnHMASgkU130BAYC+RTz73zN/sPjZezl1nMbCXmS 7jNw== 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=B/YWwXdCC3lL86OQgCfqTWbE0Dh6Rn9sTADOVBFwC3U=; fh=deCyYo6QkFncNtSlW+COYKWV+QHrPm0qFhnqufnpqmk=; b=jr340e0w6EuGOuMEuztaBEpkBBW/sX1I0yFtNfxB03OGHX0gKnnmpNXBnARItBinYW iRFfFJWVssf6yW+7H/N67TH0by1XihGwI4wQunRey9b0+HDBuaigMXbT+PPAViPlSTJf hOqELgFLFKb5Qyi5Vxvue39/5hZNNB+9DO3o5EPefCWzjiVMVBycACl2JOrXQvcJ4c/o tKLzYZZINM+KexJbSUdxqb8iaf69YbL0YaLLUfOekHDiz8rQg69AUlBjgUwbYJ/n2jzH Amv5p3x/m/7WxsfoIXc/P+mhPbjd8+5r/emrfaUnPaf4rGGcz/YVEy3Y4u9FSwCrPeFY sefw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=J2fQqp+f; 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 r10-20020a65508a000000b0050fa9bc63cbsi3513788pgp.432.2023.07.19.08.31.57; Wed, 19 Jul 2023 08:32:10 -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=J2fQqp+f; 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 S231516AbjGSPRb (ORCPT + 99 others); Wed, 19 Jul 2023 11:17:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54324 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231130AbjGSPRX (ORCPT ); Wed, 19 Jul 2023 11:17:23 -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 78032CC; Wed, 19 Jul 2023 08:17:22 -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 0A0BC61741; Wed, 19 Jul 2023 15:17:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 77B2EC433CA; Wed, 19 Jul 2023 15:17:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1689779841; bh=WUnkwoYUUaeSflcgEirZoVzc0KTIoUWAOUey/F0595E=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=J2fQqp+fG2a9bG2AbvMG+1AquX/HeauPeLpjDo/QiW2tWytYlMZTaDeYO1f1e2GCn cODJeQFzCtEeVP4k6v8KdsFloyH0ZtKW+hcvV0iPaKsmY6nLm5ZszYMBvrD4pGIQWA M7F3ODvF5ZCTp/wu6rShp4KRjVwBZHUTcGR7tNMIkDHlJUArUgqsszYvpW+4S1zc2s j7eBVU/2wGuHRKlO19C9mVf2/xOYN3P2SqYah8EsFj8lDZpWfF5sFw3lo+cB/KOQcY FgnlvPtaKFaA/DNBcEzwkl8gXGUXGqjGVsHBK3jRbcE0zg1B36AhJbhUHfmls3/ehD hVvGwULqQUo2w== From: Eric Van Hensbergen Date: Wed, 19 Jul 2023 15:17:05 +0000 Subject: [PATCH v3 1/4] fs/9p: remove unnecessary and overrestrictive check MIME-Version: 1.0 Message-Id: <20230716-fixes-overly-restrictive-mmap-v3-1-769791f474fd@kernel.org> References: <20230716-fixes-overly-restrictive-mmap-v3-0-769791f474fd@kernel.org> In-Reply-To: <20230716-fixes-overly-restrictive-mmap-v3-0-769791f474fd@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=1121; i=ericvh@kernel.org; h=from:subject:message-id; bh=WUnkwoYUUaeSflcgEirZoVzc0KTIoUWAOUey/F0595E=; b=owEBbQKS/ZANAwAKAYj/1ftKX/+YAcsmYgBkt/5+sjS/J2eXctdnFkVSGorDfItoESVfVnLlO u1TSResKW+JAjMEAAEKAB0WIQSWlvDRlqWQmKTK0VGI/9X7Sl//mAUCZLf+fgAKCRCI/9X7Sl// mKnlD/9gTDICEgt4oNIktJwJ54LppB/+HdDJ3lrDEyTHtvDiG67S5Ch9+XTOM4+RwN6L86jYnLK Mybtaze2WRW1BDBy9X3P6zzptBG60z/F8Rue9pVC2VNc02MZ1/2kF9yMLvER2uPy0Wyw1Ngvonm FHAz9Ua5eIsJewOe/h239t7qsZ2SiP3FtBHI2sVk9XWa0LZG4lYwhqCO0gobnXqZ0I+oddvNRWD 020NdzQekYrPGAQ+mHKYbBVvKCUq4IajQEltCOU6bMG1sTkkdMLuFqFunqwmtDKgb5ukgjafXbK jaY4g0kPJc6KefWoyNyskuP840uu957mED2MrA1+e3OuQOI4Tj5bnGqpMHsxYCF7FCPrGdP9nPs Bh9muCBdhe1oiG51rfB/9XQk01XBEGzbnfdc081sL9JYRII2mZSDmg3HsD5+Evb8AHQvaZq5lqx DNz9ayNhuHf0eenYlBFO+U5B4L17SPm596RydHEEs1Dj+vs269WbsPYZyKGFPb8Jd5JIyCZHIMD BLAzp0i/DoeBSft/PlWqci/Og7kTPLpC6iNv1QZwf/QW3cMaW0SR4uPoBKHRt7uPFlMW8PRCvnr oLoqyelLtyD5SR5xvPM+uexBu/25PNQB5PuiJKuZXyH7eHk13rFiMt/Rbfdn1dH+TUzBQtM0pZD SroebqlMCsc6LOg== 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: 1771863519575505170 X-GMAIL-MSGID: 1771863519575505170 This eliminates a check for shared that was overrestrictive and duplicated a check in generic_file_readonly_mmap. Fixes: 1543b4c5071c ("fs/9p: remove writeback fid and fix per-file modes") Link: 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 15:17:06 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: 122690 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c923:0:b0:3e4:2afc:c1 with SMTP id j3csp2522493vqt; Wed, 19 Jul 2023 08:36:33 -0700 (PDT) X-Google-Smtp-Source: APBJJlGDccgQ2Em4ShKzn2PfMpffbKzasVX0Nb7qKvj9pb4Mqyf0ST12pS55r1jFhDCBJa45ObxH X-Received: by 2002:a17:90b:19c3:b0:256:807e:6bd with SMTP id nm3-20020a17090b19c300b00256807e06bdmr16614251pjb.28.1689780993060; Wed, 19 Jul 2023 08:36:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689780993; cv=none; d=google.com; s=arc-20160816; b=dVk1PGpQ9xXmdXN4PBkXO/BaRxjbHBZhSoiMMMR2AySsqpsNpcTiZZLIJJvufb30Zk SZge7ID7fQL5Dz8gO9e+243053zhGG9hk9tNvC9A5WNdvqKJ0XuSYJZTBg0bvwjr6pWf KGTBgxwtajpqmatqyYbewA7cYQTsQEwaSi73RngfHkLPc27qQB2ln5dAYUpqmxKll+sU sH43Hd/7NxGQ8gctx3sTZDDjwUrOedE8qtnn4zicC2YxB6xtkHWuUGv7J4jUTb0cmWCS tOUUZHStXajspTZ8xNPuzMlbfEczasuRrvrNUzrXXLxvWAW/glZz+7vd0Aep4EYyzW0+ 8SMg== 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=fazTuyvtxaNF0knhegD+9qxwHojpihyBTl5I0Zyz0d8=; fh=deCyYo6QkFncNtSlW+COYKWV+QHrPm0qFhnqufnpqmk=; b=gtj/H/QNzhUCtpdBc46QpHTrZiIYXrCFjc3yXeyJRBAyAfcTwG5s1ZzaqNAyjlrIQH Vvl7vssJV/9otJZpV9pIPKr8dMujdYzORAOCevk7/WjGkFCyNCp32QB3zzIZBgNr+swH Rw+7Tpc2Iy5LA0KHGBdKCKdEFSDnsfm6ldj2AJ9TxsEKWrYApjxIh136Tiw5LEjGCVsY wQq04yLWVde0rJJ5DDYLijoq6SqiLx2njJuBmGYB22tblo5hVevW+IiE1IwNxU9CDRVQ j0k5KYq26DsY+ZgcpgJYoYnsdWh6eNra/UeJFu25E5HEkP4Ao6K1Pfcj5PDTthiXrKOn u1nQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="t/oe2DsB"; 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 a2-20020a17090ad80200b00259a3c7fb52si1529156pjv.27.2023.07.19.08.36.19; Wed, 19 Jul 2023 08:36:33 -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="t/oe2DsB"; 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 S231533AbjGSPRe (ORCPT + 99 others); Wed, 19 Jul 2023 11:17:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54330 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231351AbjGSPRY (ORCPT ); Wed, 19 Jul 2023 11:17:24 -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 9833BBE; Wed, 19 Jul 2023 08:17: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 288A76173E; Wed, 19 Jul 2023 15:17:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 84DD4C433C8; Wed, 19 Jul 2023 15:17:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1689779842; bh=cdptwf+tCAM2+aWoAXX9cPeXcqVcV7F8UHRwJ0Ju4kw=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=t/oe2DsB04e2eegO989Vv0cqI+6ZK/iNawU1RvdIfkuDSQ6pCeymBGqCjMhkAdNd8 vUUNDzEGV6Pdt9GW6Os5Q0hNFGyaCDP3tJJ7EIqeHxQ1wclu0Sg9jWmW6Acqx7eKYe L+hVEr98EfnROW5I/GJBIp04UoymQZ6NKneQ4nlg+1SuoqTqo1URYaAoQb+g3z4/fq jnyy5aNv4G6uQC4ZLxd+OG2fawqUDtXAXAtYf33BQXZOaLsv/T+iGg/n5g8oQfPf9m TI3lBlDRwaubvCnZ0SwRGzImqW2wCh1WpRqoJJTv0IUVS0AqrSjjRfz4hA/k8HDCLy Q/a+AKWsCMQfw== From: Eric Van Hensbergen Date: Wed, 19 Jul 2023 15:17:06 +0000 Subject: [PATCH v3 2/4] fs/9p: fix typo in comparison logic for cache mode MIME-Version: 1.0 Message-Id: <20230716-fixes-overly-restrictive-mmap-v3-2-769791f474fd@kernel.org> References: <20230716-fixes-overly-restrictive-mmap-v3-0-769791f474fd@kernel.org> In-Reply-To: <20230716-fixes-overly-restrictive-mmap-v3-0-769791f474fd@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=1068; i=ericvh@kernel.org; h=from:subject:message-id; bh=cdptwf+tCAM2+aWoAXX9cPeXcqVcV7F8UHRwJ0Ju4kw=; b=owEBbQKS/ZANAwAKAYj/1ftKX/+YAcsmYgBkt/5/HnwbXRdNIzUha4P+gQM2t1MHNIResSrWm bTMBQOwTuqJAjMEAAEKAB0WIQSWlvDRlqWQmKTK0VGI/9X7Sl//mAUCZLf+fwAKCRCI/9X7Sl// mEshD/43bFiL1TWaXPJYjtdnXsN4qkzvuLpslJVZnNOdR0dfKG4KEKO3/TYZYGt+SFSjm/6oZeh /VNFGu98+1QS5WT8+b1ezHW/hiyi22DyLyD9ohYP1Aoor9MijoDgu5YNlz/UetUSIu2+G5FjRqp K1PMamBX72Rp16AOrafjmoZM+onrZSwtQVQhjgDrRwBcM3IYSVT8IdvwSwUNQiDwcySi+AngtGq gA+3+GXEnjr2kAnLNF5PYeFbaO1z+Qsm0YcvZYn7WQi4ipCIvy5H8SZgpivpqLRnZSlgP6aMUs4 odkx+RibL0RhJ5IX+5wgby16UKrrwF/xONA9X/q6h2JGVEp9k5Rw+1mLjnxMfhpikCBV7uY8Ddd pmknhTFPko/zZHjbo21AdBBKrUewFvFV9VAReseKrmO1VlRvxvtifJ/EFKCU9gLz9wrIE4dQW6o rt6zVGgUj1vZNiJhhpBL2H7Ay+6P0c0N5smWYQFpBR8gkLxdcx098uOa7y6vsNjfKDVqmTUy77J tFgMwTSubsmTf1J1mPd43K7N0JnCabqjW0ZcXUwudu8bAPGlCi43qMw6frlFVOPjxqxCXJOC/JX IhNcXnrsc+2PgJgHVjjkkEKqk6WpzqziMHYNHJXAOgRY5vehDaIoDyQY3Dg9W7cRyvSxN1fFG/j FuashKVhN2c/19g== 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: 1771863794613982736 X-GMAIL-MSGID: 1771863794613982736 There appears to be a typo in the comparison statement for the logic which sets a file's cache mode based on mount flags. Fixes: 1543b4c5071c ("fs/9p: remove writeback fid and fix per-file modes") Link: https://lore.kernel.org/v9fs/ZK25XZ%2BGpR3KHIB%2F@pengutronix.de/ 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 15:17:07 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: 122686 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c923:0:b0:3e4:2afc:c1 with SMTP id j3csp2517534vqt; Wed, 19 Jul 2023 08:29:03 -0700 (PDT) X-Google-Smtp-Source: APBJJlHZdYq0Ho3Wu2gIcS20W8zZaOUUwPdeLqLK7edbgQw/rJlYdcNNvXlgsOLN7YbAWY5hj0ya X-Received: by 2002:a17:90b:354a:b0:263:e1db:7275 with SMTP id lt10-20020a17090b354a00b00263e1db7275mr12918325pjb.6.1689780542939; Wed, 19 Jul 2023 08:29:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689780542; cv=none; d=google.com; s=arc-20160816; b=Dksuc7rIXxIPwlPpbn3GDe3p8ZfdZ3xDrjt6ZXX9EHSwHik/WQOtOTh55VVPuyc17Y NrMn/8aY8VvwZ3NbhA/8ZPDbSuulXEZtcd7hxtOdzdyMZiZ/hWOKD1OhsCOy7xSdPzuH BJZo8N1lcNUFAGE8vA5Tsk5VBZV6zLtTIvUByTh9+m4QLp3vkZaqaK2eaWl7RFaMiDyL znKg1YmOu9FWZw164D0Db24+ByMIvg2FfM+UZcWhxit1wnIDasNn+GxJhwYwOkfnG4mN C+KoXQxd703HYa+tpCCRK2ADcjBWF8IAFyqkQxepeON6n/C656WxMTJrt2n4kszcRNqO Tr8w== 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=Ewx6TqxjeZy1GGgBwr/8zAvHrm+x2lS4VW6hUGHxsc0=; fh=deCyYo6QkFncNtSlW+COYKWV+QHrPm0qFhnqufnpqmk=; b=uTs2iOcRX5seutDC8tMXFJt/+YiBqx8n3Ug5b8ydlV+WGexjbvyATLpBeqt46Kk2XW 01Qr/4oUb2Vv9hjwWweXyKz80J6kWZ6eT1y4TYHYizik3uS4YjTwUrnIhFSr7pmBNR7C RMeSyeNi11y2uAdQ8tq3PiyQA6mpFBHBFhBOiDzF0BXZC5vGM0B8DKPbOySl0uENzlR0 T4E9RjGLz34/JYjqOC+zZEFq//iFa8X8nwHKoW3pju3DLq7hiMEkxN9sVl9QijIBXBKn aBskL9i2cBqjAZGzJZq0SMjWaYfIj1X5eRXr+ZozJv4GMFdsrJQIIWsi6y2cSaqM1EQV L85g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=fylAeVKu; 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 mh14-20020a17090b4ace00b00250331e6044si1620312pjb.25.2023.07.19.08.28.49; Wed, 19 Jul 2023 08:29:02 -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=fylAeVKu; 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 S231552AbjGSPRi (ORCPT + 99 others); Wed, 19 Jul 2023 11:17:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54340 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231414AbjGSPRZ (ORCPT ); Wed, 19 Jul 2023 11:17:25 -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 B2566CC; Wed, 19 Jul 2023 08:17: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 4269061753; Wed, 19 Jul 2023 15:17:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A62AEC433CB; Wed, 19 Jul 2023 15:17:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1689779843; bh=37fxouyOhTLlN51p11xeLF2Xq6fH1PuX7PAunRa1+I4=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=fylAeVKuZFgjAnD1Rbim39U56NZuBKOVKurcYlSzFSYgdYzCcVRgdWKtmDP8BIb8X irT9O6qEfUYfN7IkSyHpADgOlsW3uzZV8eJW/FPIeYTInOw3WZX04YljcvBdoQMtwX LU9p+6lHxJpr+LRjd+o2jXa7BE2xZqgXOe/GQQ6EgswaUtdAY5/v3Sf1sawn1qT5Z7 TIafQfzfn11/SDxcpGw72B9Y8GcCUkmOsyrlqZPCiZ5nx9TVytCWLDMgtsl+KqfIW+ H0ZxOhNhsjhOwPJEbJRDp57+X4VCvE97Z8kEgfZqtf0QR+PUzfkjPfzhkARjREd6G2 JQMm85MEBwRkA== From: Eric Van Hensbergen Date: Wed, 19 Jul 2023 15:17:07 +0000 Subject: [PATCH v3 3/4] fs/9p: fix type mismatch in file cache mode helper MIME-Version: 1.0 Message-Id: <20230716-fixes-overly-restrictive-mmap-v3-3-769791f474fd@kernel.org> References: <20230716-fixes-overly-restrictive-mmap-v3-0-769791f474fd@kernel.org> In-Reply-To: <20230716-fixes-overly-restrictive-mmap-v3-0-769791f474fd@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=1102; i=ericvh@kernel.org; h=from:subject:message-id; bh=37fxouyOhTLlN51p11xeLF2Xq6fH1PuX7PAunRa1+I4=; b=owEBbQKS/ZANAwAKAYj/1ftKX/+YAcsmYgBkt/5/NwNmg5qgKtbbcoMgW80FHdRrrxHqqWmhz 2n1QoBKK2qJAjMEAAEKAB0WIQSWlvDRlqWQmKTK0VGI/9X7Sl//mAUCZLf+fwAKCRCI/9X7Sl// mBamD/9iUHjCZ0miq5COrTtaDVZNcwtUvz0doOrSLg6zYoajcTbAiy4PdqPp8O4ZenpN7R/T29J sUGXZ8alc7Zr0M1ILxSqgok1y9mCY4Oa9Cm/SUv+rYxW29+id4od2wcEeDvui8Zmt9gsdr1DOcj j0dfZCuMqjQZX2sJSC8Ej66JcelxE7n19RES54JZIq66bOWL8e9goFce9R1kHP7XONEKipNL9Ia mrDsoXSC9fTK7Rr/FfLKDDuJaozbdM3mubfXOVDMvGY4LOElfs/B1Gq7VwFckXKIdjhAQkALify +UpIwqbK6jNppC21fXJLP97G4WIQzodpq/QTzBF+n590RKPvpiIMxrAIU5ReUhtrksDgVkw8ETp 72YAhRXHJU+9m6B+Ld3TVI70Swj8uVp+0BSrjX0HRghg8JIedOD/lhMfnj3D/Vp7m4jUsTcTjxu GNknf78iSbzfOa0ZTpwpRm0Wg6XqbVT7FfoKddOp3KPARi2CYa6yoxWDinOtWJAO9wcF+MSsk6t DV6wcJrOqNUGe78rcSPyrqrqW18jazl/sloFJXmmGgz4iFnG8hob/a0AgYgJ/CnAenIG1k35W6v mNFDNcJbIVWHti3YwC+289Bfd0X7ayQ/AYSv/7lSRs9S26K8ZO8ARRcB1PvVAe4nw6ZAJV/+fly nIWB0prL0tfJ0Zw== 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: 1771863322480471754 X-GMAIL-MSGID: 1771863322480471754 There were two flags (s_flags and s_cache) which had incorrect signed type in the parameters of the file cache mode helper function. Fixes: 1543b4c5071c ("fs/9p: remove writeback fid and fix per-file modes") Link: https://lore.kernel.org/v9fs/ZK25XZ%2BGpR3KHIB%2F@pengutronix.de/ 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 15:17:08 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: 122682 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c923:0:b0:3e4:2afc:c1 with SMTP id j3csp2515600vqt; Wed, 19 Jul 2023 08:25:37 -0700 (PDT) X-Google-Smtp-Source: APBJJlGs3MSzAkuiJPg86ZuBknl6ODkpQjfiBEKoyDYaAW/pgwm3nFHrCsao5Q4GEMxiihTZDNiN X-Received: by 2002:a17:902:9f96:b0:1b6:72af:623d with SMTP id g22-20020a1709029f9600b001b672af623dmr14106398plq.55.1689780336859; Wed, 19 Jul 2023 08:25:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689780336; cv=none; d=google.com; s=arc-20160816; b=po9LsBBwr+ju61z1XyfzooJcM6HTWzcsrpy7EOEOeYRj5dwM5v2K9zmsZ8nppufUKC eBZMlL/83XE3XXD7G8dZ3Ziu/0grOaV/YVXjMZkvB+77EmW1hwmGMQBkwBNI/YLqY1uh iJCCC6w3bv9gKTDtEWxCWGHaztJDkbzK8oA0SQ4oK0w6sIjUtjTneajMNltnF7mNnGla oI5iMVhhazr3n/QkuJ77DucVd2aBvCVPRILgvN3MaSJpvYHz7TaWVYcX4A/29WJ2xTlw JfZKTcg6FxVWJTWGpB2oejh43CllKVhKE485H3dNe8wUA659zhi/ZBcoKw1GQQjWhzmk XYJA== 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=eJ+MMKqh3xqoiiLzp2QDt+PAL1DZIlnILxOSyA6LzAk=; fh=deCyYo6QkFncNtSlW+COYKWV+QHrPm0qFhnqufnpqmk=; b=fHf9KsmWeqCdGEJwsugGcDtsP1Urt2rQ8hi/UbwnkdDb2r0T3PGsv+4glF4gJucF9V wmWsYVx9MAQrkNX9eUP1RTx9syrWxlUcu2H6YAca/SF5p5VIZ51r7UnRi3SgvcjYNO7v ZX5HfxCtIHfmGlHH+d2RX04Qd1LSWL9Ga1MLWcaZcDxYsPbb8iwLZQ+i8WDnorSyNLlC SxYe3JQQcuHlaZ/SFULbw66Zpw2slAyb+VuxVXSN31bg176Cxl0LFDTnyKGd1Ybefwp+ /FGD26HIzIYztjLkfM9vfJXD1QL6b8IBNoz0ZcxZFFlmku0bCNPp5WrsvZYzNkPAh6x9 G8sw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="CbHavf/c"; 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 e4-20020a17090301c400b001b84f9263e7si3765418plh.325.2023.07.19.08.25.21; Wed, 19 Jul 2023 08:25:36 -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="CbHavf/c"; 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 S231522AbjGSPRm (ORCPT + 99 others); Wed, 19 Jul 2023 11:17:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54348 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229957AbjGSPR0 (ORCPT ); Wed, 19 Jul 2023 11:17: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 830C7BE; Wed, 19 Jul 2023 08:17: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 5D85161759; Wed, 19 Jul 2023 15:17:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C1355C433CA; Wed, 19 Jul 2023 15:17:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1689779844; bh=E6XjzAYb9Wv8oYLom3aRYwYdeEdNznryP3hobD0L6AA=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=CbHavf/cQw/xrJlvtM3ACNoao/JKPypDZv35q57vsOt11oXryHyVXIhg7rqCYegCl 2LzXAH28+xVSLuy1j5g6NyJ2uZ0Es4NeqsoDjdYWabjKbQRXHO4PwFqOoKk2M4mmbH 9hHRUW4s8FxVGA6HbuF088TbCSFfRWBFPsizt4r7jCY5G+OWGvHWkc7HvchkvGFP5s OEZP6mPDYVXT56i6Fz0eGtUjm6Zt8Kqezl6/P1kPeWOvi+jR1K0y/DXNx0lqHwEkhq EyOI1VriQRDO81Tr9GmNUPhjSWOouEDEVpOr6bmEN7pWaNSve8+7Dz5ZJuXJ3Y2trv LDeWzoVp5/NgA== From: Eric Van Hensbergen Date: Wed, 19 Jul 2023 15:17:08 +0000 Subject: [PATCH v3 4/4] fs/9p: remove unnecessary invalidate_inode_pages2 MIME-Version: 1.0 Message-Id: <20230716-fixes-overly-restrictive-mmap-v3-4-769791f474fd@kernel.org> References: <20230716-fixes-overly-restrictive-mmap-v3-0-769791f474fd@kernel.org> In-Reply-To: <20230716-fixes-overly-restrictive-mmap-v3-0-769791f474fd@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=850; i=ericvh@kernel.org; h=from:subject:message-id; bh=E6XjzAYb9Wv8oYLom3aRYwYdeEdNznryP3hobD0L6AA=; b=owEBbQKS/ZANAwAKAYj/1ftKX/+YAcsmYgBkt/5/O/0AVC5JOGzadqwGbJJ1VIXriZIyzCt4q YAmlkbSB9CJAjMEAAEKAB0WIQSWlvDRlqWQmKTK0VGI/9X7Sl//mAUCZLf+fwAKCRCI/9X7Sl// mI35EACitPglHMdcam1474rTYkZfuDo0JBuCs+MFd+lWN98XeGkTRk7hKEELWQIlnzFiHogaR99 2jCVCuVR1zV9hcdTcc49gAwPqAJbc2uLjXkUAYsLECXzrK6Ow7nM5zDmub2meHGMrRj4PJfKVl2 A4WkW3pgGaaAol8PWLJgmPCHaLxOY2HLr4u+rhn1LbjTJoW7hCQSt72WzFqUlZFGwbxyu8jmswR Ba60h6VUMVTzYI5AjGjA2Bfoc3X7G0Ls8KmuyugRQ1dxpKcR7pMqJbz8ktLYQwsEmMR3V5GdU/x T76NPEurUOV0VeBV5RIK8/Jr9CYfIYhw52TC82jx99RrEfJt6KBADEJUMRiWkMBmY7HL1FM7c2S Dgunry2SxIlEfY7PoiY7HW/nXKalrS32MZuUBi8O5JfP/N5nX9ECJrxZiRYh6hkz58gzcPlptHX kFEXPs7IuWAVwL67RPvNPkc5x+HegNUeNi76vswaRjlTyWVK9f2CmUdunJtiWrJxzGjVJQcNz6D icBiieMND9MYYnC10DVn5nhyKz0UIZRdD2UGb1G1SGg3ttYQ0wnVNj7Du1/IgP/xLHy70UnyPwf 40OjowiBp0DkxsXVsuRgm29GTAwA6k4Jt0FzguDuQM+GLbEMo9y1iOXllGrKzBb8PKsWNcu88Mi sbjkcO9IeuCgCOg== 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: 1771863106789780966 X-GMAIL-MSGID: 1771863106789780966 There was an invalidate_inode_pages2 added to mmap that is unnecessary. Fixes: 1543b4c5071c ("fs/9p: remove writeback fid and fix per-file modes") Link: https://lore.kernel.org/v9fs/ZK25XZ%2BGpR3KHIB%2F@pengutronix.de/ 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); }