aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/super.c
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2006-08-24 01:03:05 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2006-09-22 23:24:54 -0400
commit5dd3177ae5012c1e2ad7a9ffdbd0e0d0de2f60e4 (patch)
tree2a8730d6443f6d33e8879cfc323396f9a570b97b /fs/nfs/super.c
parent275a082fe9308e710324e26ccb5363c53d8fd45f (diff)
NFSv4: Fix a use-after-free issue with the nfs server.
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/super.c')
-rw-r--r--fs/nfs/super.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/fs/nfs/super.c b/fs/nfs/super.c
index 97cfb143e09..665949d2779 100644
--- a/fs/nfs/super.c
+++ b/fs/nfs/super.c
@@ -883,13 +883,15 @@ static int nfs4_get_sb(struct file_system_type *fs_type,
883 goto out_free; 883 goto out_free;
884 } 884 }
885 885
886 if (s->s_fs_info != server) {
887 nfs_free_server(server);
888 server = NULL;
889 }
890
886 if (!s->s_root) { 891 if (!s->s_root) {
887 /* initial superblock/root creation */ 892 /* initial superblock/root creation */
888 s->s_flags = flags; 893 s->s_flags = flags;
889
890 nfs4_fill_super(s); 894 nfs4_fill_super(s);
891 } else {
892 nfs_free_server(server);
893 } 895 }
894 896
895 mntroot = nfs4_get_root(s, &mntfh); 897 mntroot = nfs4_get_root(s, &mntfh);