aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/inode.c
diff options
context:
space:
mode:
authorJeff Layton <jlayton@redhat.com>2010-12-07 02:10:35 -0500
committerSteve French <sfrench@us.ibm.com>2010-12-07 14:25:37 -0500
commit7d161b7f41e24203b54b0f18ae0d26c18a6c6fab (patch)
tree10219d15bed51128f72e2e45fc58947071fed0c9 /fs/cifs/inode.c
parent03ceace5c6923ffbcf2b4d2e37afbffbdb5d4a67 (diff)
cifs: allow calling cifs_build_path_to_root on incomplete cifs_sb
It's possible that cifs_mount will call cifs_build_path_to_root on a newly instantiated cifs_sb. In that case, it's likely that the master_tlink pointer has not yet been instantiated. Fix this by having cifs_build_path_to_root take a cifsTconInfo pointer as well, and have the caller pass that in. Reported-and-Tested-by: Robbert Kouprie <robbert@exx.nl> Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs/inode.c')
-rw-r--r--fs/cifs/inode.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c
index aa48521a78c1..589f3e3f6e00 100644
--- a/fs/cifs/inode.c
+++ b/fs/cifs/inode.c
@@ -728,12 +728,12 @@ static const struct inode_operations cifs_ipc_inode_ops = {
728 .lookup = cifs_lookup, 728 .lookup = cifs_lookup,
729}; 729};
730 730
731char *cifs_build_path_to_root(struct cifs_sb_info *cifs_sb) 731char *cifs_build_path_to_root(struct cifs_sb_info *cifs_sb,
732 struct cifsTconInfo *tcon)
732{ 733{
733 int pplen = cifs_sb->prepathlen; 734 int pplen = cifs_sb->prepathlen;
734 int dfsplen; 735 int dfsplen;
735 char *full_path = NULL; 736 char *full_path = NULL;
736 struct cifsTconInfo *tcon = cifs_sb_master_tcon(cifs_sb);
737 737
738 /* if no prefix path, simply set path to the root of share to "" */ 738 /* if no prefix path, simply set path to the root of share to "" */
739 if (pplen == 0) { 739 if (pplen == 0) {
@@ -875,7 +875,7 @@ struct inode *cifs_root_iget(struct super_block *sb, unsigned long ino)
875 char *full_path; 875 char *full_path;
876 struct cifsTconInfo *tcon = cifs_sb_master_tcon(cifs_sb); 876 struct cifsTconInfo *tcon = cifs_sb_master_tcon(cifs_sb);
877 877
878 full_path = cifs_build_path_to_root(cifs_sb); 878 full_path = cifs_build_path_to_root(cifs_sb, tcon);
879 if (full_path == NULL) 879 if (full_path == NULL)
880 return ERR_PTR(-ENOMEM); 880 return ERR_PTR(-ENOMEM);
881 881