[linux-cifs-client] endianness of uniqueid value in FILE_UNIX_BASIC_INFO

Jeff Layton jlayton at redhat.com
Sat Mar 28 21:17:40 GMT 2009


Is the UniqueID field in FILE_UNIX_BASIC_INFO supposed to little endian
when it goes over the wire?

In the Linux CIFS code, the uniqueid value in FILE_UNIX_BASIC_INFO
(what's returned by a QPathInfo with a SMB_QUERY_FILE_UNIX_BASIC
infolevel) is listed as "__u64" (no endianness annotation).

In that code, we're not converting its endianness. We just use that
value off the wire as-is, basically treating it as opaque. Should we
be treating the uniqueid field as little endian like the rest of the
values in that struct? For reference, here's the FILE_UNIX_BASIC_INFO
definition:

typedef struct {
        __le64 EndOfFile;
        __le64 NumOfBytes;
        __le64 LastStatusChange; /*SNIA specs DCE time for the 3 time fields */
        __le64 LastAccessTime;
        __le64 LastModificationTime;
        __le64 Uid;
        __le64 Gid;
        __le32 Type;
        __le64 DevMajor;
        __le64 DevMinor;
        __u64 UniqueId;
        __le64 Permissions;
        __le64 Nlinks;
} __attribute__((packed)) FILE_UNIX_BASIC_INFO; /* level 0x200 QPathInfo */


...it seems to be like the UniqueId ought to also be considered __le64.
-- 
Jeff Layton <jlayton at redhat.com>


More information about the linux-cifs-client mailing list