| @@ -80,18 +80,15 @@ int nfs_get_root(struct super_block *s, struct fs_context *fc) · 79 unmodified lines |
| 80 | goto out; | 80 | goto out; |
| 81 | | 81 | |
| 82 | /* get the actual root for this mount */ | 82 | /* get the actual root for this mount */ |
| 83 | fsinfo.fattr = nfs_alloc_fattr(); | 83 | fsinfo.fattr = nfs_alloc_fattr_with_label(server); |
| 84 | if (fsinfo.fattr == NULL) | 84 | if (fsinfo.fattr == NULL) |
| 85 | goto out_name; | 85 | goto out_name; |
| 86 | | 86 | |
| 87 | fsinfo.fattr->label = nfs4_label_alloc(server, GFP_KERNEL); | | |
| 88 | if (IS_ERR(fsinfo.fattr->label)) | | |
| 89 | goto out_fattr; | | |
| 90 | error = server->nfs_client->rpc_ops->getroot(server, ctx->mntfh, &fsinfo); | 87 | error = server->nfs_client->rpc_ops->getroot(server, ctx->mntfh, &fsinfo); |
| 91 | if (error < 0) { | 88 | if (error < 0) { |
| 92 | dprintk("nfs_get_root: getattr error = %d\n", -error); | 89 | dprintk("nfs_get_root: getattr error = %d\n", -error); |
| 93 | nfs_errorf(fc, "NFS: Couldn't getattr on root"); | 90 | nfs_errorf(fc, "NFS: Couldn't getattr on root"); |
| 94 | goto out_label; | 91 | goto out_fattr; |
| 95 | } | 92 | } |
| 96 | | 93 | |
| 97 | inode = nfs_fhget(s, ctx->mntfh, fsinfo.fattr, NULL); | 94 | inode = nfs_fhget(s, ctx->mntfh, fsinfo.fattr, NULL); |
| @@ -99,12 +96,12 @@ int nfs_get_root(struct super_block *s, struct fs_context *fc) · 1 unmodified line |
| 99 | dprintk("nfs_get_root: get root inode failed\n"); | 96 | dprintk("nfs_get_root: get root inode failed\n"); |
| 100 | error = PTR_ERR(inode); | 97 | error = PTR_ERR(inode); |
| 101 | nfs_errorf(fc, "NFS: Couldn't get root inode"); | 98 | nfs_errorf(fc, "NFS: Couldn't get root inode"); |
| 102 | goto out_label; | 99 | goto out_fattr; |
| 103 | } | 100 | } |
| 104 | | 101 | |
| 105 | error = nfs_superblock_set_dummy_root(s, inode); | 102 | error = nfs_superblock_set_dummy_root(s, inode); |
| 106 | if (error != 0) | 103 | if (error != 0) |
| 107 | goto out_label; | 104 | goto out_fattr; |
| 108 | | 105 | |
| 109 | /* root dentries normally start off anonymous and get spliced in later | 106 | /* root dentries normally start off anonymous and get spliced in later |
| 110 | * if the dentry tree reaches them; however if the dentry already | 107 | * if the dentry tree reaches them; however if the dentry already |
| @@ -115,7 +112,7 @@ int nfs_get_root(struct super_block *s, struct fs_context *fc) · 4 unmodified lines |
| 115 | dprintk("nfs_get_root: get root dentry failed\n"); | 112 | dprintk("nfs_get_root: get root dentry failed\n"); |
| 116 | error = PTR_ERR(root); | 113 | error = PTR_ERR(root); |
| 117 | nfs_errorf(fc, "NFS: Couldn't get root dentry"); | 114 | nfs_errorf(fc, "NFS: Couldn't get root dentry"); |
| 118 | goto out_label; | 115 | goto out_fattr; |
| 119 | } | 116 | } |
| 120 | | 117 | |
| 121 | security_d_instantiate(root, inode); | 118 | security_d_instantiate(root, inode); |
| @@ -154,8 +151,6 @@ int nfs_get_root(struct super_block *s, struct fs_context *fc) · 32 unmodified lines |
| 154 | nfs_setsecurity(inode, fsinfo.fattr, fsinfo.fattr->label); | 151 | nfs_setsecurity(inode, fsinfo.fattr, fsinfo.fattr->label); |
| 155 | error = 0; | 152 | error = 0; |
| 156 | | 153 | |
| 157 | out_label: | | |
| 158 | nfs4_label_free(fsinfo.fattr->label); | | |
| 159 | out_fattr: | 154 | out_fattr: |
| 160 | nfs_free_fattr(fsinfo.fattr); | 155 | nfs_free_fattr(fsinfo.fattr); |
| 161 | out_name: | 156 | out_name: |
| @@ -165,5 +160,5 @@ out: · 3 unmodified lines |
| 165 | error_splat_root: | 160 | error_splat_root: |
| 166 | dput(fc->root); | 161 | dput(fc->root); |
| 167 | fc->root = NULL; | 162 | fc->root = NULL; |
| 168 | goto out_label; | 163 | goto out_fattr; |
| 169 | } | 164 | } |