On Fri, 22 Nov 2013 11:26:55 +0100 Gregor Beck <gbeck@xxxxxxxxx> wrote: Some explanation of the rationale for this might be nice. > --- > smb1ops.c | 20 +++++++++++++++----- > 1 file changed, 15 insertions(+), 5 deletions(-) > > diff --git a/smb1ops.c b/smb1ops.c > index 635b1e5..a12e370 100644 > --- a/smb1ops.c > +++ b/smb1ops.c > @@ -540,11 +540,23 @@ cifs_query_path_info(const unsigned int xid, struct cifs_tcon *tcon, > FILE_ALL_INFO *data, bool *adjustTZ) > { > int rc; > + const int remap = cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR; > > /* could do find first instead but this returns more info */ > rc = CIFSSMBQPathInfo(xid, tcon, full_path, data, 0 /* not legacy */, > - cifs_sb->local_nls, cifs_sb->mnt_cifs_flags & > - CIFS_MOUNT_MAP_SPECIAL_CHR); > + cifs_sb->local_nls, remap); > + > + if (rc == -EIO) { > + rc = CIFSSMBQPathInfoBasic(xid, tcon, full_path, > + (FILE_BASIC_INFO*)data, > + cifs_sb->local_nls, remap); > + if (!rc) { > + rc = CIFSSMBQPathInfoStandard(xid, tcon, full_path, > + (void*)data + sizeof(FILE_BASIC_INFO), > + cifs_sb->local_nls, remap); > + } > + } > + I don't get the above. Why do the Basic call at all if you're just going to overwrite the returned info with the standard one when it succeeds? > /* > * BB optimize code so we do not make the above call when server claims > * no NT SMB support and the above call failed at least once - set flag > @@ -552,9 +564,7 @@ cifs_query_path_info(const unsigned int xid, struct cifs_tcon *tcon, > */ > if ((rc == -EOPNOTSUPP) || (rc == -EINVAL)) { > rc = SMBQueryInformation(xid, tcon, full_path, data, > - cifs_sb->local_nls, > - cifs_sb->mnt_cifs_flags & > - CIFS_MOUNT_MAP_SPECIAL_CHR); > + cifs_sb->local_nls, remap); > *adjustTZ = true; > } > return rc; -- Jeff Layton <jlayton@xxxxxxxxxx> -- 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