[PATCH 5/9] fallback to CIFSSMBQPathInfoBasic() in cifs_is_path_accessible()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



---
 smb1ops.c |   13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/smb1ops.c b/smb1ops.c
index 6094397..635b1e5 100644
--- a/smb1ops.c
+++ b/smb1ops.c
@@ -513,20 +513,23 @@ cifs_is_path_accessible(const unsigned int xid, struct cifs_tcon *tcon,
 {
 	int rc;
 	FILE_ALL_INFO *file_info;
+	const int remap = cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR;
 
 	file_info = kmalloc(sizeof(FILE_ALL_INFO), GFP_KERNEL);
 	if (file_info == NULL)
 		return -ENOMEM;
 
 	rc = CIFSSMBQPathInfo(xid, tcon, full_path, file_info,
-			      0 /* not legacy */, cifs_sb->local_nls,
-			      cifs_sb->mnt_cifs_flags &
-				CIFS_MOUNT_MAP_SPECIAL_CHR);
+			      0 /* not legacy */, cifs_sb->local_nls, remap);
+	if (rc == -EIO) {
+		rc = CIFSSMBQPathInfoBasic(xid, tcon, full_path,
+					   (FILE_BASIC_INFO*)file_info,
+					   cifs_sb->local_nls, remap);
+	}
 
 	if (rc == -EOPNOTSUPP || rc == -EINVAL)
 		rc = SMBQueryInformation(xid, tcon, full_path, file_info,
-				cifs_sb->local_nls, cifs_sb->mnt_cifs_flags &
-				  CIFS_MOUNT_MAP_SPECIAL_CHR);
+					 cifs_sb->local_nls, remap);
 	kfree(file_info);
 	return rc;
 }
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-cifs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux