From patchwork Mon Jan 8 15:18:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Van Hensbergen X-Patchwork-Id: 186036 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:37c1:b0:101:2151:f287 with SMTP id y1csp1084661dyq; Mon, 8 Jan 2024 07:19:08 -0800 (PST) X-Google-Smtp-Source: AGHT+IFZoTkq1XgWPwSKQtxLMB9Dono7s+TJXct3DeXxVPeV2NzWW0avtPQCvFPdhmEYfyvvdTzS X-Received: by 2002:a05:6a20:432b:b0:199:6a8d:4b47 with SMTP id h43-20020a056a20432b00b001996a8d4b47mr5293031pzk.92.1704727148554; Mon, 08 Jan 2024 07:19:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704727148; cv=none; d=google.com; s=arc-20160816; b=d4DvvVqgb3gkvxq/1ZWZFcHARJghoAAKigzdchjLwSaNllXeZA2hp68DI7pCOnZ6hv RcG44ZNe1kKiXHVcK7WARwa16V8v0xq6+1rUAPvlY02TbMk7fTkkACwtl8BwAFPzigt1 XlQvJdASSSrqiEcI4F/qGNSk2aQxNQ9loFmb630ZpOW2q+ivul9PQT/xAOqrTBmse64z A8qNDlDzswrQPdgCOSL/AfUpPVgvAvzwi+xpdjODQxvJ9gYzubxOszLXo+XEbms621dR A86db5S6m/ui19FrTjl4qxiNRtN03/gXz0PGi6XZb7FjWhDVKQlL4/SmETayFn1NSSa3 wlbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=f6Zbmxe9kB3idnjeYXjdFSRIS52myKN0cOB0cHARXeE=; fh=34zNr7a0BVYUu9GLC6Z8rO/FcAceqP5NONmRFRP2POA=; b=iRLlfe9FQBwSuqeF2McQnSmOInLBhUEInPw2kz9jhivnJfQe9knnGhbdGdJWHg89hf d75aJprvb6kCWeq31+CZwzlB6PKJWDylSeVDMqLfHKnLEYIhtY4gjF0nagp5j3rKm5G3 r7aJtPyLwMJy/ucv6teZNZmnZr6HTtPyN7nEdMP6fzNAgRMUYlSxMcNAY1OUiAWKbdaw 5iOJKikzCmLf/6ODaWxbJXWduA4H/VASJf9WdAJUgHYaQIFdWiOss89unt0hNRgc4EyN PHblI3AsOMjIIpuY3qkaf0KmyvKIt+X88VULpOQzdPEvpoZUN/mKjkIQESy4n3fSRd/y gKFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=gvJFHb9X; spf=pass (google.com: domain of linux-kernel+bounces-19747-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-19747-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id y67-20020a636446000000b005cdf851b5ffsi5981627pgb.537.2024.01.08.07.19.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Jan 2024 07:19:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-19747-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=gvJFHb9X; spf=pass (google.com: domain of linux-kernel+bounces-19747-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-19747-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 529A0284799 for ; Mon, 8 Jan 2024 15:19:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5E24F51C46; Mon, 8 Jan 2024 15:18:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="gvJFHb9X" X-Original-To: linux-kernel@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AC9F14C610; Mon, 8 Jan 2024 15:18:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CB16DC433D9; Mon, 8 Jan 2024 15:18:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1704727109; bh=FzqC8vGfSQKqsymfIdQBKBTvSoDcKJkKyoEMFGNr5Uk=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=gvJFHb9Xq0bzJfqeoSEGCf46TqK7pW8iIA3JfYScQ5bMzgQKusktpVugjcf+bnaTL 9d4PGxUgbUzzKz/dBm0AtNmD/mcCkHhr8XISUr3K1V6vpXwRmX0wJiAYoqoLS5oDPS m2XoZFONLVnSemx1zCmy/l4j64iyGF2tZgQKtq5Yb8rTsIx0ZMupXr7aktEP7a/0DB vZo5LOeiJWdthDDXP/lbn6l2rpFb6iPMdZQGDnbDIFE8zM0QzzQQ92CDLdyVxjZ11n QRnduPh4FfEpjnZ7QKHKaGyn6pqBHbItOoixHzdzVGC75Q/staHKB4wKGSQwT2pgnk 3otHs/0DLb0Sg== From: Eric Van Hensbergen Date: Mon, 08 Jan 2024 15:18:17 +0000 Subject: [PATCH v2 1/8] fs/9p: switch vfsmount to use v9fs_get_new_inode Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240108-ericvh-fix-cache-dups-v2-1-a73f8822838c@kernel.org> References: <20240108-ericvh-fix-cache-dups-v2-0-a73f8822838c@kernel.org> In-Reply-To: <20240108-ericvh-fix-cache-dups-v2-0-a73f8822838c@kernel.org> To: Latchesar Ionkov , Dominique Martinet , Christian Schoenebeck Cc: v9fs@lists.linux.dev, linux-kernel@vger.kernel.org, Eric Van Hensbergen X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=1973; i=ericvh@kernel.org; h=from:subject:message-id; bh=FzqC8vGfSQKqsymfIdQBKBTvSoDcKJkKyoEMFGNr5Uk=; b=owEBbQKS/ZANAwAKAYj/1ftKX/+YAcsmYgBlnBJCcsP0XfYsl1bHEYlKvirxIWNqyGqk06LyC AIHCFd/voeJAjMEAAEKAB0WIQSWlvDRlqWQmKTK0VGI/9X7Sl//mAUCZZwSQgAKCRCI/9X7Sl// mHnAEACDKZbFob0ZtPl7iWvsU3dfgcfLKnTJf/egIgnl7cVoO6PsIpz3hB3X0A4jloQnBDmg6X7 FXJv9lxQc0vk1yhrmhEII/z7DSFWr2bq/h5Y8pxJENWouNmVtGHzq0bdvx5iYs61pepRQsOw3+M oXzKEHqqkziWCWzWmSG4Pmy2FoFkyfWcL9X8eY4URoZmcQUNVqozhgfpOUWOTDZvB6MJyOHlhy1 LxAa4snk7LtnamWSdirXRaYWor/8YKZ4T3uMwdnhsmdr5j4xJTTWIgeSLHn1u7HJR27ieyDeZpV pYTb5cGFq5TnGVlKkPPj5iqksQrvP9wbKQrT3CzftOz6DyYei20l6UOcUp0rCn4WekMV8TSlOS1 xt1xjja5HNf9tw72lJpgz+J0mbkQSACOFV5jmTcngnnHzTKPXc31btAd/yjIrWU5Ct9psZe14vs xIyCTjxmGSkr1tfxAMwdJsbPXxW+LY7QIWkP6f+QsMgzNKV9Vs2716niEve1YQ/mLSHzHONDpVx iKtsQZUZVUwfhtcqCYViPKBi6/Ts4VjqvXKOZu9mHOObMWkBbO0ubkI6Gco0dMex5CXITlbIHDx 8gXwaAz2+ZmpBNFtJ7CX3zJN0BWOnFT5nQz+VhJbxT52cqEEy0Mx3YGmrNjPMxGG7O+5IkJqUBE SFf1uHf5GqeDvVQ== X-Developer-Key: i=ericvh@kernel.org; a=openpgp; fpr=9696F0D196A59098A4CAD15188FFD5FB4A5FFF98 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1787535973975453365 X-GMAIL-MSGID: 1787535973975453365 In the process of cleaning up inode number allocation, I noticed several functions which didn't use the standard helper allocators. This patch fixes the allocation in the mount entrypoint. Signed-off-by: Eric Van Hensbergen --- fs/9p/vfs_super.c | 29 +---------------------------- 1 file changed, 1 insertion(+), 28 deletions(-) diff --git a/fs/9p/vfs_super.c b/fs/9p/vfs_super.c index 73db55c050bf..8d14cc0b3916 100644 --- a/fs/9p/vfs_super.c +++ b/fs/9p/vfs_super.c @@ -110,7 +110,6 @@ static struct dentry *v9fs_mount(struct file_system_type *fs_type, int flags, struct inode *inode = NULL; struct dentry *root = NULL; struct v9fs_session_info *v9ses = NULL; - umode_t mode = 0777 | S_ISVTX; struct p9_fid *fid; int retval = 0; @@ -140,7 +139,7 @@ static struct dentry *v9fs_mount(struct file_system_type *fs_type, int flags, else sb->s_d_op = &v9fs_dentry_operations; - inode = v9fs_get_inode(sb, S_IFDIR | mode, 0); + inode = v9fs_get_new_inode_from_fid(v9ses, fid, sb); if (IS_ERR(inode)) { retval = PTR_ERR(inode); goto release_sb; @@ -152,32 +151,6 @@ static struct dentry *v9fs_mount(struct file_system_type *fs_type, int flags, goto release_sb; } sb->s_root = root; - if (v9fs_proto_dotl(v9ses)) { - struct p9_stat_dotl *st = NULL; - - st = p9_client_getattr_dotl(fid, P9_STATS_BASIC); - if (IS_ERR(st)) { - retval = PTR_ERR(st); - goto release_sb; - } - d_inode(root)->i_ino = v9fs_qid2ino(&st->qid); - v9fs_stat2inode_dotl(st, d_inode(root), 0); - kfree(st); - } else { - struct p9_wstat *st = NULL; - - st = p9_client_stat(fid); - if (IS_ERR(st)) { - retval = PTR_ERR(st); - goto release_sb; - } - - d_inode(root)->i_ino = v9fs_qid2ino(&st->qid); - v9fs_stat2inode(st, d_inode(root), sb, 0); - - p9stat_free(st); - kfree(st); - } retval = v9fs_get_acl(inode, fid); if (retval) goto release_sb;