Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp1680733rdb; Sat, 3 Feb 2024 18:18:22 -0800 (PST) X-Google-Smtp-Source: AGHT+IHTfw/32DKIigdvK4BiulrBAf8KeAtUtDzwhwRtP0c6PFvr1t7G94GIatl8XjlImiwNddg1 X-Received: by 2002:ae9:e30c:0:b0:784:3802:9a41 with SMTP id v12-20020ae9e30c000000b0078438029a41mr9312740qkf.6.1707013102448; Sat, 03 Feb 2024 18:18:22 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707013102; cv=pass; d=google.com; s=arc-20160816; b=CbD77Lvn56yV8F2F5w19lEoCbfL2ikFqWaOdOyIv5n5zqF06LtIDwL3HwPmo+AYWk8 ckjtyXP2bbnUrv5oLSHFdIrS+6LJP4cJLfbZNYcpZ/YD6ijzuPEiP23YEUBj/Ek1CpxM wzBj4rNGdP9hYHSNjX7CIiZfJ2Selut/dA4aJv4AS+mu/vEmNtrcsLmjZz8sT9omigdF AvrlSpENniqDUXjXjysOjxJhPiUzck5H19gv/ckEfJ4rem2QdBCyFtORFSf4FVgRazsY WmEmJ6RQHnuFRzHX4HOtyuxOuLH1phmpt9IWwwDFgL5bW0vgEK/ks5rjBn9SZiqCcmCC 1jBg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=2MCHJybCgYaM+84/EVYU2f3B/ucLwt2OnRgR5X2eSlU=; fh=XcnoEpx7ei/iQCL1aDxM8VJnUX/+m/8jH3ugeDOAFmc=; b=ZcA27LsAy4In72U6T5XVg21i7Mvudtd+z7YbbTOwWUoD+El5EDSbhZjCvk+DF/huI4 SnXd4Gv9wg55lKFy6a6DV7iY724jfc7tKlvHNDVsPZG5nBp5fRWtC3Dfrp9csO7wEWJM 1Zq8q1X0EpRgvQq05o0ELe6Y8uSnfDI/8NXaIJK0UNQ9KdmEQYhCBhzazFd9hIwGzwP+ GnqvMo1QEWW8phfNIYV9svj+6HqXAjbxikfAvkdB/5WyQ4xP9QXq9SaeOwwyNMxMlYFl EnVd8aVCqirGs8MiELrImAGZQdv6f6/NwRMjaV0AdfMTYVNUoQd5FLOsY2HcDy4SN4B0 YgdQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.org.uk header.s=zeniv-20220401 header.b=MOvylI1s; arc=pass (i=1 dkim=pass dkdomain=linux.org.uk dmarc=pass fromdomain=zeniv.linux.org.uk); spf=pass (google.com: domain of linux-nfs+bounces-1740-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-nfs+bounces-1740-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zeniv.linux.org.uk X-Forwarded-Encrypted: i=1; AJvYcCUDzC87rJR1EOvHaFrS+McOPdUXVDHfKP6gZMwlryEmMFgB2k04BVlt2tdeffit+17T7QOotk2vCGWjmFNEbvlgPD1UQLJCfmVyWKFw7Q== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id c21-20020a05620a135500b00783d8b62023si5715173qkl.59.2024.02.03.18.18.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 03 Feb 2024 18:18:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs+bounces-1740-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.org.uk header.s=zeniv-20220401 header.b=MOvylI1s; arc=pass (i=1 dkim=pass dkdomain=linux.org.uk dmarc=pass fromdomain=zeniv.linux.org.uk); spf=pass (google.com: domain of linux-nfs+bounces-1740-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-nfs+bounces-1740-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zeniv.linux.org.uk 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 2285C1C21D3A for ; Sun, 4 Feb 2024 02:18:22 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 04C118BF3; Sun, 4 Feb 2024 02:17:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linux.org.uk header.i=@linux.org.uk header.b="MOvylI1s" X-Original-To: linux-nfs@vger.kernel.org Received: from zeniv.linux.org.uk (zeniv.linux.org.uk [62.89.141.173]) (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 211407494; Sun, 4 Feb 2024 02:17:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=62.89.141.173 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707013064; cv=none; b=Mwefz59v8HdRyr/TXEpF8JB9wTMY2wxxjdnaSiBN3uZPrfpJ/lAyyB/q4tdjq4jTr2Sjc+3dlI5rq+8EGcJf3CNAEDthE1X2+sDY3+SrrawNPexoBYqNdogM7q3xRI/sBKTCzF2StrqPcyWSQC8yek1K3ud/wavFNlaDza658aY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707013064; c=relaxed/simple; bh=SRyqAW1bia3hA8WIBq/eWJxl2UkyBOHfh9gjJgn/9+U=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Nl59LYbP2WLWFW/+YKCeBSaqJnpmaLZUzq4YJHisH4z7tKY2uoR6EKGHZbdNtM1SSZBMNYA0qa4m+Z8GI3URgPfGC3bJ4nTwWU/QS8il2hS6FSnnbS+T+Yq8CzlL/nt+CtC/rjDOBiGtdc66XfGB6lNODaJp5HMBcuutwa4eVhY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=zeniv.linux.org.uk; spf=none smtp.mailfrom=ftp.linux.org.uk; dkim=pass (2048-bit key) header.d=linux.org.uk header.i=@linux.org.uk header.b=MOvylI1s; arc=none smtp.client-ip=62.89.141.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=zeniv.linux.org.uk Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=ftp.linux.org.uk DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=linux.org.uk; s=zeniv-20220401; h=Sender:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description; bh=2MCHJybCgYaM+84/EVYU2f3B/ucLwt2OnRgR5X2eSlU=; b=MOvylI1sLs+VkTsnYxUlcCbdjL U50l+BmHsg3tffvDT9d+Smjpm0cjKfGXZSPSt3mG7t3Bb5+fFDcu84WFg+x72pucepx2+rF6GQ4Ey SiMfCD3rzV18SlgxemYbn0eb1WIznW5xyp4ReYtdeWxhUnBjwmUbQlf4GjbK2ev1UU7icsGP5sd+S GguhTeGgxzcmo4cGWHbHjDT49W1GnsR5je9PItjHESxyRME6ibDPEbNpU9UoB8MtHSFlwYrFaEf+D zV7qHDDsi61fysxfLLcPRSV0Uxs5QD6jzcfdWwQPhV7qMxZee2Ce+Hmm9ZPizVmc6OykF2silVbhj +M7GrRjw==; Received: from viro by zeniv.linux.org.uk with local (Exim 4.96 #2 (Red Hat Linux)) id 1rWS4j-004rDW-1V; Sun, 04 Feb 2024 02:17:41 +0000 From: Al Viro To: linux-fsdevel@vger.kernel.org Cc: Linus Torvalds , Christian Brauner , linux-ext4@vger.kernel.org, linux-nfs@vger.kernel.org, Miklos Szeredi , linux-cifs@vger.kernel.org Subject: [PATCH 10/13] procfs: make freeing proc_fs_info rcu-delayed Date: Sun, 4 Feb 2024 02:17:36 +0000 Message-Id: <20240204021739.1157830-10-viro@zeniv.linux.org.uk> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240204021739.1157830-1-viro@zeniv.linux.org.uk> References: <20240204021436.GH2087318@ZenIV> <20240204021739.1157830-1-viro@zeniv.linux.org.uk> Precedence: bulk X-Mailing-List: linux-nfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: Al Viro makes proc_pid_ns() safe from rcu pathwalk (put_pid_ns() is still synchronous, but that's not a problem - it does rcu-delay everything that needs to be) Signed-off-by: Al Viro --- fs/proc/root.c | 2 +- include/linux/proc_fs.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/proc/root.c b/fs/proc/root.c index b55dbc70287b..06a297a27ba3 100644 --- a/fs/proc/root.c +++ b/fs/proc/root.c @@ -271,7 +271,7 @@ static void proc_kill_sb(struct super_block *sb) kill_anon_super(sb); put_pid_ns(fs_info->pid_ns); - kfree(fs_info); + kfree_rcu(fs_info, rcu); } static struct file_system_type proc_fs_type = { diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h index de407e7c3b55..0b2a89854440 100644 --- a/include/linux/proc_fs.h +++ b/include/linux/proc_fs.h @@ -65,6 +65,7 @@ struct proc_fs_info { kgid_t pid_gid; enum proc_hidepid hide_pid; enum proc_pidonly pidonly; + struct rcu_head rcu; }; static inline struct proc_fs_info *proc_sb_info(struct super_block *sb) -- 2.39.2