Skip to content

Commit

Permalink
NFS: Remove dead code from nfs_fs_mount()
Browse files Browse the repository at this point in the history
In fs/nfs/super.c::nfs_fs_mount() we test for a NULL 'data':

...
 		if (data == NULL || mntfh == NULL)
 			goto out_free_fh;
...

and then further down in the function we test 'data' again:

...
 			nfs_fscache_get_super_cookie(
 				s, data ? data->fscache_uniq : NULL, NULL);
...

this second check is just dead code since there is no way 'data' could
possibly be NULL here.
We also rely on a non-NULL 'data' in more than one location between these
two tests, further proving the point that the second test is bogus.

This patch removes the dead code.

Signed-off-by: Jesper Juhl <[email protected]>
Signed-off-by: Trond Myklebust <[email protected]>
  • Loading branch information
jjuhl authored and Trond Myklebust committed Apr 12, 2011
1 parent 6faf9a5 commit 160bc16
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions fs/nfs/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -2235,8 +2235,7 @@ static struct dentry *nfs_fs_mount(struct file_system_type *fs_type,
if (!s->s_root) {
/* initial superblock/root creation */
nfs_fill_super(s, data);
nfs_fscache_get_super_cookie(
s, data ? data->fscache_uniq : NULL, NULL);
nfs_fscache_get_super_cookie(s, data->fscache_uniq, NULL);
}

mntroot = nfs_get_root(s, mntfh, dev_name);
Expand Down

0 comments on commit 160bc16

Please sign in to comment.