[CIFS] Fix endian errors (setfacl/getfacl failures) in handling ACLs
[powerpc.git] / fs / cifs / netmisc.c
index 873b812..f781468 100644 (file)
@@ -813,7 +813,7 @@ map_smb_to_linux_error(struct smb_hdr *smb)
        if (smb->Flags2 & SMBFLG2_ERR_STATUS) {
                /* translate the newer STATUS codes to old style errors and then to POSIX errors */
                __u32 err = le32_to_cpu(smb->Status.CifsError);
-               if(cifsFYI)
+               if(cifsFYI & CIFS_RC)
                        cifs_print_status(err);
                ntstatus_to_dos(err, &smberrclass, &smberrcode);
        } else {
@@ -868,7 +868,14 @@ unsigned int
 smbCalcSize(struct smb_hdr *ptr)
 {
        return (sizeof (struct smb_hdr) + (2 * ptr->WordCount) +
-               BCC(ptr));
+               2 /* size of the bcc field */ + BCC(ptr));
+}
+
+unsigned int
+smbCalcSize_LE(struct smb_hdr *ptr)
+{
+       return (sizeof (struct smb_hdr) + (2 * ptr->WordCount) +
+               2 /* size of the bcc field */ + le16_to_cpu(BCC_LE(ptr)));
 }
 
 /* The following are taken from fs/ntfs/util.c */