aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Layton <jlayton@redhat.com>2011-05-17 06:40:30 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2011-05-21 15:13:27 -0700
commitba0bb0c9b289b919dc7b106a26ee05e1516171a8 (patch)
tree81b2723cc63e0406cf77e865ad46f783351faf52
parent758b8cc02fae512d6748a87d1c8656a94b1fecaa (diff)
downloadlinux-linaro-android-ba0bb0c9b289b919dc7b106a26ee05e1516171a8.tar.gz
cifs: add fallback in is_path_accessible for old servers
commit 221d1d797202984cb874e3ed9f1388593d34ee22 upstream. The is_path_accessible check uses a QPathInfo call, which isn't supported by ancient win9x era servers. Fall back to an older SMBQueryInfo call if it fails with the magic error codes. Reported-and-Tested-by: Sandro Bonazzola <sandro.bonazzola@gmail.com> Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve French <sfrench@us.ibm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--fs/cifs/connect.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index bd7e61fbd27..1f4db2cca33 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -2657,6 +2657,11 @@ is_path_accessible(int xid, struct cifsTconInfo *tcon,
0 /* not legacy */, cifs_sb->local_nls,
cifs_sb->mnt_cifs_flags &
CIFS_MOUNT_MAP_SPECIAL_CHR);
+
+ if (rc == -EOPNOTSUPP || rc == -EINVAL)
+ rc = SMBQueryInformation(xid, tcon, full_path, pfile_info,
+ cifs_sb->local_nls, cifs_sb->mnt_cifs_flags &
+ CIFS_MOUNT_MAP_SPECIAL_CHR);
kfree(pfile_info);
return rc;
}