summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Layton <jlayton@redhat.com>2011-05-17 06:40:30 -0400
committerPaul Gortmaker <paul.gortmaker@windriver.com>2012-03-14 10:57:58 -0400
commita1c6160164a5b217b6ebfc501ea430150e7acf95 (patch)
tree83df10c27578d9c6fa7d86d15eb7df5550e9fc9f
parent3afd3f179ac0f1c07288f7346f986f3134378388 (diff)
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: Paul Gortmaker <paul.gortmaker@windriver.com>
-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 cebbc2983c84..1f6aae0a006f 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -2254,6 +2254,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;
}