Received: by 2002:a05:7412:98c1:b0:fa:551:50a7 with SMTP id kc1csp1690845rdb; Mon, 8 Jan 2024 07:19:51 -0800 (PST) X-Google-Smtp-Source: AGHT+IFxmY/Qk0FfUJOvFBQbulXLsBnczUJFwFPhFDCkcGZQP0EoXW0gziWd4nxEWKjx4UvQRd92 X-Received: by 2002:a17:90b:3e81:b0:28b:da84:164c with SMTP id rj1-20020a17090b3e8100b0028bda84164cmr1887145pjb.81.1704727191701; Mon, 08 Jan 2024 07:19:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704727191; cv=none; d=google.com; s=arc-20160816; b=sPAVoBH6imNlpL/tY9oJf7Bavc/T+R1UHzprzoFA9QaU5D9WOTTlswNKjaVYkpxg0e UIIOi7TIs8PRqBGvYyWXOJmGSiCKDC60pv53CLh9tr4yVBDXbCLSiz0GJgoeTnAocdF7 nXfnqy+jdKZ7dh5jhErNpqNh3+5ZMvBoBvjpNcC9wcSaF75lvxegenlZa0il1CK3GvHY ftUzQI8MrBCHynvvV2RkH7sKiU67hcMG6KzS45P2Go415tijiHN8Ej3Syd6P8EOPKsrD 7thsv5aJFWLhPmo3m/66H5BeqMmp9eP7cKOCLgIun2NuIlCDsPBm74JWQFYupBzc+9bG pxqQ== 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-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-19747-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id q7-20020a17090a9f4700b0028ca417b2fdsi55846pjv.106.2024.01.08.07.19.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Jan 2024 07:19:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-19747-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; 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-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-19747-linux.lists.archive=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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 52758B22C85 for ; Mon, 8 Jan 2024 15:18:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 814294BA96; Mon, 8 Jan 2024 15:18:30 +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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit 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 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; -- 2.41.0