* [PATCH 1/1] SQUASHME pnfs_submit: move unmount_pnfs_layoutdriver call
@ 2010-05-11 22:24 andros
2010-05-12 6:52 ` Benny Halevy
0 siblings, 1 reply; 2+ messages in thread
From: andros @ 2010-05-11 22:24 UTC (permalink / raw)
To: bhalevy; +Cc: bharrosh, linux-nfs, Andy Adamson
From: Andy Adamson <andros@netapp.com>
from nfs4_kill_super to nfs_free_server. Fixes a bug reported by Boaz Harrosh
where the deviceid cache is not defererenced on super block creation error or
for two mounts that share a super block.
Signed-off-by: Andy Adamson <andros@netapp.com>
---
fs/nfs/client.c | 9 +++++++++
fs/nfs/super.c | 3 ---
2 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/fs/nfs/client.c b/fs/nfs/client.c
index 56f3d50..0337330 100644
--- a/fs/nfs/client.c
+++ b/fs/nfs/client.c
@@ -884,6 +884,14 @@ static void nfs4_init_pnfs(struct nfs_server *server, struct nfs_fsinfo *fsinfo)
#endif /* CONFIG_NFS_V4_1 */
}
+static void nfs4_uninit_pnfs(struct nfs_server *server)
+{
+#if defined(CONFIG_NFS_V4_1)
+ if (nfs4_has_session(server->nfs_client))
+ unmount_pnfs_layoutdriver(server);
+#endif /* CONFIG_NFS_V4_1 */
+}
+
/*
* Load up the server record from information gained in an fsinfo record
*/
@@ -1039,6 +1047,7 @@ void nfs_free_server(struct nfs_server *server)
{
dprintk("--> nfs_free_server()\n");
+ nfs4_uninit_pnfs(server);
spin_lock(&nfs_client_lock);
list_del(&server->client_link);
list_del(&server->master_link);
diff --git a/fs/nfs/super.c b/fs/nfs/super.c
index 5fc60cf..7822187 100644
--- a/fs/nfs/super.c
+++ b/fs/nfs/super.c
@@ -2799,9 +2799,6 @@ static void nfs4_kill_super(struct super_block *sb)
dprintk("--> %s\n", __func__);
nfs_super_return_all_delegations(sb);
kill_anon_super(sb);
-#ifdef CONFIG_NFS_V4_1
- unmount_pnfs_layoutdriver(server);
-#endif
nfs_fscache_release_super_cookie(sb);
nfs_free_server(server);
dprintk("<-- %s\n", __func__);
--
1.6.6
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH 1/1] SQUASHME pnfs_submit: move unmount_pnfs_layoutdriver call
2010-05-11 22:24 [PATCH 1/1] SQUASHME pnfs_submit: move unmount_pnfs_layoutdriver call andros
@ 2010-05-12 6:52 ` Benny Halevy
0 siblings, 0 replies; 2+ messages in thread
From: Benny Halevy @ 2010-05-12 6:52 UTC (permalink / raw)
To: andros; +Cc: bharrosh, linux-nfs
On 2010-05-12 01:24, andros@netapp.com wrote:
> From: Andy Adamson <andros@netapp.com>
>
> from nfs4_kill_super to nfs_free_server. Fixes a bug reported by Boaz Harrosh
> where the deviceid cache is not defererenced on super block creation error or
> for two mounts that share a super block.
Looks good to me.
Thanks!
Benny
>
> Signed-off-by: Andy Adamson <andros@netapp.com>
> ---
> fs/nfs/client.c | 9 +++++++++
> fs/nfs/super.c | 3 ---
> 2 files changed, 9 insertions(+), 3 deletions(-)
>
> diff --git a/fs/nfs/client.c b/fs/nfs/client.c
> index 56f3d50..0337330 100644
> --- a/fs/nfs/client.c
> +++ b/fs/nfs/client.c
> @@ -884,6 +884,14 @@ static void nfs4_init_pnfs(struct nfs_server *server, struct nfs_fsinfo *fsinfo)
> #endif /* CONFIG_NFS_V4_1 */
> }
>
> +static void nfs4_uninit_pnfs(struct nfs_server *server)
> +{
> +#if defined(CONFIG_NFS_V4_1)
> + if (nfs4_has_session(server->nfs_client))
> + unmount_pnfs_layoutdriver(server);
> +#endif /* CONFIG_NFS_V4_1 */
> +}
> +
> /*
> * Load up the server record from information gained in an fsinfo record
> */
> @@ -1039,6 +1047,7 @@ void nfs_free_server(struct nfs_server *server)
> {
> dprintk("--> nfs_free_server()\n");
>
> + nfs4_uninit_pnfs(server);
> spin_lock(&nfs_client_lock);
> list_del(&server->client_link);
> list_del(&server->master_link);
> diff --git a/fs/nfs/super.c b/fs/nfs/super.c
> index 5fc60cf..7822187 100644
> --- a/fs/nfs/super.c
> +++ b/fs/nfs/super.c
> @@ -2799,9 +2799,6 @@ static void nfs4_kill_super(struct super_block *sb)
> dprintk("--> %s\n", __func__);
> nfs_super_return_all_delegations(sb);
> kill_anon_super(sb);
> -#ifdef CONFIG_NFS_V4_1
> - unmount_pnfs_layoutdriver(server);
> -#endif
> nfs_fscache_release_super_cookie(sb);
> nfs_free_server(server);
> dprintk("<-- %s\n", __func__);
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-05-12 6:52 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-11 22:24 [PATCH 1/1] SQUASHME pnfs_submit: move unmount_pnfs_layoutdriver call andros
2010-05-12 6:52 ` Benny Halevy
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.