From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752604AbbCWCjv (ORCPT ); Sun, 22 Mar 2015 22:39:51 -0400 Received: from cantor2.suse.de ([195.135.220.15]:34550 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752530AbbCWCjs (ORCPT ); Sun, 22 Mar 2015 22:39:48 -0400 From: NeilBrown To: Al Viro Date: Mon, 23 Mar 2015 13:37:40 +1100 Subject: [PATCH 18/20] xfs: use RCU to free 'struct xfs_mount'. Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Message-ID: <20150323023740.8161.39099.stgit@notabene.brown> In-Reply-To: <20150323023258.8161.32467.stgit@notabene.brown> References: <20150323023258.8161.32467.stgit@notabene.brown> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In order for ->follow_link to be safe in RCU-walk, any data structures accessed need to be freed after an RCU grace period. 'struct xfs_mount' is not currently guaranteed to be delayed sufficiently, so use kfree_rcu() to free it. Signed-off-by: NeilBrown --- fs/xfs/xfs_mount.h | 2 ++ fs/xfs/xfs_super.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/fs/xfs/xfs_mount.h b/fs/xfs/xfs_mount.h index 0d8abd6364d9..6a1094e493e9 100644 --- a/fs/xfs/xfs_mount.h +++ b/fs/xfs/xfs_mount.h @@ -185,6 +185,8 @@ typedef struct xfs_mount { * to various other kinds of pain inflicted on the pNFS server. */ __uint32_t m_generation; + + struct rcu_head m_rcu; } xfs_mount_t; /* diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c index 8fcc4ccc5c79..3827be14383c 100644 --- a/fs/xfs/xfs_super.c +++ b/fs/xfs/xfs_super.c @@ -1047,7 +1047,7 @@ xfs_fs_put_super( xfs_destroy_mount_workqueues(mp); xfs_close_devices(mp); xfs_free_fsname(mp); - kfree(mp); + kfree_rcu(mp, m_rcu); } STATIC int