BCC_LE macro in "cifspdu.h" is not well defined. The sizeof(structure smb_hdr) is odd (go ahead, count the bytes) and the BCC_LE attempts to do a 16 bit access from an odd address. This renders the whole CIFS pretty much unusable on all CPUs that cannot handle misaligned accesses. The macro should use "unaligned" access.
No objection to fixing it so that it works better on such architectures. Care to offer up a patch or explanation of how you think it should work?
(In reply to comment #1) > No objection to fixing it so that it works better on such architectures. Care > to offer up a patch or explanation of how you think it should work? The macro BCC_LE is used in several files, sometimes to read and sometimes to write a 16 bit le value. The best I could come was to split the macro into two macros: #define BCC_LE_GET(smb_var) get_unaligned_le16((char*)smb_var + sizeof(struct smb_hdr)+(2*smb_var->WordCount)) #define BCC_LE_PUT(smb_var) put_unaligned_le16((char*)smb_var + sizeof(struct smb_hdr)+(2*smb_var->WordCount)) and change the files "connect.c","netmisc.c","transport.c" and "sess.c" to use the new macros. It is quite likely there is a better way to do this.
If you're still interested in fixing this, could you spin up patches against recent mainline git (or even better, against Steve French's tree). Then please post them to linux-cifs@vger.kernel.org so we can review them. Thanks!
*** This bug has been marked as a duplicate of bug 11115 ***