The VFS dirsort module should not walk directories twice. Patch will follow.
Created attachment 12914 [details] patch for 4.6, 4.5 and 4.4
Comment on attachment 12914 [details] patch for 4.6, 4.5 and 4.4 LGTM.
Re-assigning to Karolin for inclusion in 4.6.next, 4.5.next, 4.4.next.
(In reply to Jeremy Allison from comment #3) Patch does not apply on all three current branches. user@#host:/data/git/samba/v4-6-test$ git am ../v4-4-test/bug-12531-4.4v1 Applying: s3: smbd: Correctly canonicalize any incoming shadow copy path. error: patch failed: source3/smbd/filename.c:220 error: source3/smbd/filename.c: patch does not apply
Created attachment 12922 [details] patch for 4.4
Created attachment 12923 [details] patch for 4.5
Created attachment 12924 [details] patch for 4.6
This patch only applies to source3/modules/vfs_dirsort.c it doesn't touch source3/smbd/filename.c. Did you try to apply the wrong patch? However I cherry-picked the patch again to all branches and generated it there.
Yes, I did test the original patches applied cleanly to 4.6.x, 4.5.x and 4.4.x and compiled before adding my +1.
Might be that I tried the wrong patch, sorry. Pushed to autobuild-v4-{6,5,4}-test.
(In reply to Karolin Seeger from comment #10) Pushed to all branches. Closing out bug report. Thanks!