Bug 13047 - apple client can't cope with SMB2 async replies when creating symlinks.
Summary: apple client can't cope with SMB2 async replies when creating symlinks.
Status: RESOLVED FIXED
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: File services (show other bugs)
Version: unspecified
Hardware: All All
: P5 normal (vote)
Target Milestone: ---
Assignee: Karolin Seeger
QA Contact: Samba QA Contact
URL:
Keywords:
: 11596 (view as bug list)
Depends on:
Blocks:
 
Reported: 2017-09-22 02:25 UTC by Jeremy Allison
Modified: 2017-11-15 11:35 UTC (History)
5 users (show)

See Also:


Attachments
git-am fix for 4.7.next (9.05 KB, patch)
2017-09-22 16:39 UTC, Jeremy Allison
cs: review+
Details
git-am fix for 4.6.next (9.01 KB, patch)
2017-09-22 16:43 UTC, Jeremy Allison
cs: review+
Details
Updated fix for 4.6.next. (9.09 KB, patch)
2017-11-01 17:40 UTC, Jeremy Allison
no flags Details
Patch for 4.6 backported from master (9.01 KB, patch)
2017-11-13 19:33 UTC, Ralph Böhme
jra: review+
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jeremy Allison 2017-09-22 02:25:55 UTC
The Apple client creates symlinks with a compounded SMB2 create/write/close.

When Samba is set to use async io read/write size less than the symlink size, we return an intermediate response to the client, which cannot cope with this and fails.

Patch from Christof Schmitt <cs@samba.org> to follow.
Comment 1 Jeremy Allison 2017-09-22 16:39:01 UTC
Created attachment 13623 [details]
git-am fix for 4.7.next

Cherry-picked from master.
Comment 2 Jeremy Allison 2017-09-22 16:43:48 UTC
Created attachment 13624 [details]
git-am fix for 4.6.next

Back-ported from master cherry-pick.
Comment 3 Christof Schmitt 2017-09-22 17:37:32 UTC
(In reply to Jeremy Allison from comment #0)
To clarify: Samba returned NT_STATUS_IO_ERROR in this case, which is correct according to the spec, but leads to an application error on the client.
Comment 4 Christof Schmitt 2017-09-22 17:37:50 UTC
(In reply to Christof Schmitt from comment #3)
Sorry, meant to write INTERNAL_ERROR.
Comment 5 Jeremy Allison 2017-09-22 17:44:36 UTC
Re-assigning to Karolin for inclusion in 4.7.next, 4.6.next.
Comment 6 Jeremy Allison 2017-09-22 18:51:58 UTC
*** Bug 11596 has been marked as a duplicate of this bug. ***
Comment 7 Karolin Seeger 2017-11-01 09:29:41 UTC
(In reply to Jeremy Allison from comment #5)
Pushed to autobuild-v4-7-test.

Patch for v4-6-test does not apply on current branch (source3/selftest/tests.py:458
error: source3/selftest/tests.py: Patch konnte nicht angewendet werden
Anwendung des Patches fehlgeschlagen bei 0004 selftest: Also run smbtorture smb2.compound with aio enabled)
Comment 8 Jeremy Allison 2017-11-01 17:40:32 UTC
Created attachment 13749 [details]
Updated fix for 4.6.next.

Just needed to move a couple of lines in the selftest part of the patch.
Comment 9 Karolin Seeger 2017-11-13 08:16:27 UTC
(In reply to Jeremy Allison from comment #8)
Thanks!
Pushed to autobuild-v4-6-test.
Comment 10 Karolin Seeger 2017-11-13 09:36:32 UTC
(In reply to Karolin Seeger from comment #9)
Patches seem to break autobuild-v4-6-test:

Waf: Leaving directory `/memdisk/kseeger/a46/b2181556/samba/bin'
'build' finished successfully (6.675s)
skipping subunit (testscenarios not available)
  File "/memdisk/kseeger/a46/b2181556/samba/source3/selftest/tests.py", line 468
    plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/aio -U$USERNAME%$PASSWORD', '
                                                                                    ^
SyntaxError: EOL while scanning string literal
Error creating recipe from /usr/bin/python /memdisk/kseeger/a46/b2181556/samba/source3/selftest/tests.py| at /memdisk/kseeger/a46/b2181556/samba/selftest/selftest.pl line 647.
make: *** [test] Error 1
Comment 11 Jeremy Allison 2017-11-13 18:29:52 UTC
That's strange (the 4.6.x test breakage). Ralph, any chance you can take a look (I'm off sick today).
Comment 12 Ralph Böhme 2017-11-13 19:33:19 UTC
Created attachment 13774 [details]
Patch for 4.6 backported from master
Comment 13 Jeremy Allison 2017-11-13 20:20:10 UTC
Comment on attachment 13774 [details]
Patch for 4.6 backported from master

Works great Ralph, thanks. Don't know where I screwed up the previous backport.
Comment 14 Jeremy Allison 2017-11-13 20:21:30 UTC
Re-assigning to Karolin for inclusion in 4.7.next.
Comment 15 Karolin Seeger 2017-11-14 09:46:18 UTC
(In reply to Ralph Böhme from comment #12)
Thanks! :-)
Pushed to autobuild-v4-6-test.
Comment 16 Karolin Seeger 2017-11-15 11:35:52 UTC
(In reply to Karolin Seeger from comment #15)
Pushed to v4-6-test.
Closing out bug report.

Thanks!