From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D7AC3EB64DD for ; Tue, 1 Aug 2023 09:51:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233695AbjHAJvu (ORCPT ); Tue, 1 Aug 2023 05:51:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50384 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233701AbjHAJvb (ORCPT ); Tue, 1 Aug 2023 05:51:31 -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 C888A1985 for ; Tue, 1 Aug 2023 02:51:09 -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 50A7E614F5 for ; Tue, 1 Aug 2023 09:51:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 61E89C433C7; Tue, 1 Aug 2023 09:51:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1690883468; bh=b2vX+9Aej4/+tHWd3qLzJGnYcZmg0ccTNaIOibTA2sQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XfUmeon8iXsnocRGV1H0edYONVA0hYB8B6w8s5ao9poPYZRlwuIzhNqfrDspiVhX0 WwY0Vw5cqscvqjddwei0ho8aSiTYbYDl0wz8lQeaCPmsd5CXDvTThnPlkCEgXAz/xT iof0TJSdnmN1oFAE8V2exVVkBkwmeg/tpHFPTdA8= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Robert Schwebel , Dominique Martinet , Christian Schoenebeck , Eric Van Hensbergen Subject: [PATCH 6.4 217/239] fs/9p: remove unnecessary and overrestrictive check Date: Tue, 1 Aug 2023 11:21:21 +0200 Message-ID: <20230801091933.739976804@linuxfoundation.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230801091925.659598007@linuxfoundation.org> References: <20230801091925.659598007@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Eric Van Hensbergen commit 75b396821cb71164dac3a1ad51dda4781ea8dbad upstream. 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 Signed-off-by: Greg Kroah-Hartman --- fs/9p/vfs_file.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) --- a/fs/9p/vfs_file.c +++ b/fs/9p/vfs_file.c @@ -483,9 +483,7 @@ v9fs_file_mmap(struct file *filp, struct 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); }