Hi, I working on porting Samba 4.2.2 to the OS/2 operating system. OS/2 makes extensive use of extended attributes. The current OS/2 port is based on Samba 3.6, and with that version, I am able to successfully create EA's (aka xattr) of > 9k on a Windows 2008 server. Since updating my client to use Samba 4.2.2, I can only create EA's < ~950 bytes. I can reproduce this with smbclient from Samba 4.1.13 on Ubuntu using: smb: \> setea 2014.jpg TEST abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz set_ea \2014.jpg: NT_STATUS_INSUFF_SERVER_RESOURCES Unfortunate there is not much debug logging that is relevant even with -d 10 Any suggestions?
Interestingly, creating xattr using setea with a size > 1k works fine to a server running OS/2. So it may be an issue specific to servers running on Windows
EA creation also seems to work fine with a Samba 3.6.6 server running on a Raspberry Pi - so the problem seems to only affect servers running Windows
it appears the problem with a Windows server is a protocol issue. smbclient uses NT1 by default and EA transfer fails. If I use -m=SMB2 to force SMB2, EA transfer works. This still doesn't explain why EA transfer with NT1 works with smbclient from Samba 3.6
Some more testing: smbclient from ubuntu to a Win2k08 server: smb: \> setea apr-1.5.1-unix.diff TEST abcdef smb: \> setea apr-1.5.1-unix.diff TEST2 abcdefghijklmnopqrstuvwxyz smb: \> geteas apr-1.5.1-unix.diff TEST (0) = [0000] 61 62 63 64 65 66 abcdef TEST (0) = [0000] 61 62 63 64 65 66 abcdef Note the second EA that is set ends up as a duplicate of the first one. Same as above but writing to a Linux Samba server: Domain=[WORKGROUP] OS=[Unix] Server=[Samba 3.6.6] smb: \> setea apr-1.5.1-unix.diff TEST abcdef smb: \> setea apr-1.5.1-unix.diff TEST2 abcdefghijklmnopqrstuvwxyz smb: \> geteas apr-1.5.1-unix.diff TEST (0) = [0000] 61 62 63 64 65 66 abcdef TEST2 (0) = [0000] 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F 70 abcdefgh ijklmnop [0010] 71 72 73 74 75 76 77 78 79 7A qrstuvwx yz EA creation works fine :/
..and more interesting - geteas from smbclient from samba 3.6 shows the expected EA's from the test in the previous comments
ie: smb: \> geteas apr-1.5.1-unix.diff TEST (0) = [0000] 61 62 63 64 65 66 abcdef TEST2 (0) = [0000] 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F 70 abcdefgh ijklmnop [0010] 71 72 73 74 75 76 77 78 79 7A qrstuvwx yz
Note: the issues with geteas mentioned in comments 4 through 6 seem to appear only when SMB2 is used. With SMB1 geteas works OK.
Created attachment 12094 [details] proposed patch There was a change to libsmbclient in Samba 4.0 that limited the amount of EA information that can be written over non SMB2/3 connections. With this patch I was able to write 3k of EA information to a Windows 8 machine over both SMB2 and NT1. Any chance you can give it some testing in your environment?
(In reply to Christian Ambach from comment #8) Hi Christian - looks good to me. Tested on a server running win2k8 server and all seems OK :) Thanks for the fix!
As far as I can see in MS-CIFS section 2.2.6.7.2 the max data response is zero, not 2 (2 is the parameter response size). Can you test this replacing the 2 with zero ? Thanks, Jeremy.
Created attachment 12099 [details] updated patch Paul, can you give the updated patch a test as well? Thanks!
(In reply to Christian Ambach from comment #11) Hi Christian - updated patch appears to work as well based on limited testing
Yes, I can also confirm that writing to W2K8 R2 this latest patch with the 4.4.3 client from OS/2 I am able to back up an entire desktop (with EAs intact). I see both file and directory EAs getting cleanly written. Nicely done!
Created attachment 12101 [details] git-am fix for 4.4.next, 4.3.next Cherry-picked from master.
Re-assigning to Karolin for inclusion in 4.4.next, 4.3.next.
(In reply to Jeremy Allison from comment #15) Pushed to autobuild-v4-[3|4]-test.
(In reply to Karolin Seeger from comment #16) Pushed to both branches. Closing out bug report. Thanks!