Bug 11486 - Invalid Create File error response STATUS_NOT_A_DIRECTORY
Summary: Invalid Create File error response STATUS_NOT_A_DIRECTORY
Status: RESOLVED FIXED
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: File services (show other bugs)
Version: 4.1.18
Hardware: All FreeBSD
: P5 normal (vote)
Target Milestone: ---
Assignee: Karolin Seeger
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-09-03 02:28 UTC by Max (LoadDynamix)
Modified: 2015-10-12 18:46 UTC (History)
1 user (show)

See Also:


Attachments
Shorted version of pcap (13.23 KB, application/vnd.tcpdump.pcap)
2015-09-03 02:38 UTC, Max (LoadDynamix)
no flags Details
LoadDynamiX test to reproduce problem (3.08 KB, application/x-zip-compressed)
2015-09-03 23:39 UTC, Max (LoadDynamix)
no flags Details
git-am fix for master (5.94 KB, patch)
2015-09-23 03:00 UTC, Jeremy Allison
no flags Details
Updated git-am patch for master (6.36 KB, patch)
2015-09-23 23:10 UTC, Jeremy Allison
no flags Details
git-am fix for 4.3.next, 4.2.next (6.70 KB, patch)
2015-09-24 17:00 UTC, Jeremy Allison
vl: review+
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Max (LoadDynamix) 2015-09-03 02:28:15 UTC
When server receives 2 simultaneous requests from different clients (different IP) to create same name directory in same share sometimes server responds to second client with weird error code STATUS_NOT_A_DIRECTORY.

Pcap attached showing bad and good behavior 


Here is table to easy understand problem (it includes packet #s to easy much pcap):

                   First Pair                    |                  Second Pair
 Client 1               | Client 2               | Client 3               | Client 4
------------------------+------------------------+------------------------+------------------------
                        |                        |44 > TreeConnect ivan1  | 
46 > TreeConnect ivan01 |                        |                        | 
                        |50 > TreeConnect ivan01 |                        | 
                        |                        |                        |53 > TreeConnect ivan1
55 < TreeConnect SUCCESS|                        |                        | 
56 > Create             |                        |                        | 
                        |                        |58 < TreeConnect SUCCESS| 
                        |                        |59 > Create             | 
                        |61 < TreeConnect SUCCESS|                        | 
                        |62 > Create             |                        | 
                        |                        |                        |64 < TreeConnect SUCCESS
                        |                        |                        |65 > Create 
                        |67 < Create ERROR       |                        | 
70 < Create SUCCESS     |                        |                        | 
                        |                        |76 < Create SUCCESS     | 
                        |                        |                        |79 < Create SUCCESS

Format:
Packet# Direction Command [parameters/response code]

Please note First Pair and second Pair are using different shares but order of commands is same
except server responds to Client 2 Create File request faster with ERROR

Test executed against FreeNAS box with Samba 4.1.8 inside
Comment 1 Max (LoadDynamix) 2015-09-03 02:38:30 UTC
Created attachment 11396 [details]
Shorted version of pcap

Cannot upload full pcap. So here is a short version.
Comment 2 Max (LoadDynamix) 2015-09-03 02:46:25 UTC
In short pcap version all packets shifted by 2 so here is new table.

                   First Pair                    |                  Second Pair
 Client 1               | Client 2               | Client 3               | Client 4
------------------------+------------------------+------------------------+------------------------
                        |                        |42 > TreeConnect ivan1  | 
44 > TreeConnect ivan01 |                        |                        | 
                        |48 > TreeConnect ivan01 |                        | 
                        |                        |                        |51 > TreeConnect ivan1
53 < TreeConnect SUCCESS|                        |                        | 
54 > Create             |                        |                        | 
                        |                        |56 < TreeConnect SUCCESS| 
                        |                        |57 > Create             | 
                        |59 < TreeConnect SUCCESS|                        | 
                        |60 > Create             |                        | 
                        |                        |                        |62 < TreeConnect SUCCESS
                        |                        |                        |63 > Create 
                        |65 < Create ERROR       |                        | 
68 < Create SUCCESS     |                        |                        | 
                        |                        |74 < Create SUCCESS     | 
                        |                        |                        |77 < Create SUCCESS
Comment 3 Volker Lendecke 2015-09-03 13:11:47 UTC
(In reply to Max (LoadDynamix) from comment #2)

Can you get us a debug level 10 log of smbd together with a fresh network trace? Ideally, we would prefer a separate log per smbd process, for example set

log file = /var/log/samba/log.smbd.%d
Comment 4 Max (LoadDynamix) 2015-09-03 23:37:35 UTC
Sorry, I do not have idea how to access our FreeNAS and how to control samba there. Scenario is simple and should be easy to reproduce. 

If you will see problem with reproduction yourself I have attached test for our appliance (LoadDynamiX) which was used to catch this bug.
Samba has our appliance in the lab so it'll be question to get access to our box and run the test. You can contact Jeremy Allison, Ira Cooper or Jose Rivera they should know where our box is.
Comment 5 Max (LoadDynamix) 2015-09-03 23:39:14 UTC
Created attachment 11409 [details]
LoadDynamiX test to reproduce problem
Comment 6 Volker Lendecke 2015-09-04 05:57:32 UTC
(In reply to Max (LoadDynamix) from comment #5)

Hi!

I'm surprised FreeNAS is so locked down that it won't even let you ssh into it. Thats bad. Can you contact your FreeNAS supplier for assistance how to get Samba logfiles out of the box?

It might be trivial for you to reproduce, but I am not in the position to run a LoadDynamics box every day.

Is LoadDynamics (formerly SwiftTest, right?) at SDC again? We could ask them to run this against a Samba box.
Comment 7 Jeremy Allison 2015-09-04 16:56:58 UTC
Max, I'm local to you. So if you want this looked at before SNIA SDC ping me and I can come visit and take a look.

Cheers,

Jeremy.
Comment 8 Max (LoadDynamix) 2015-09-06 04:45:51 UTC
Volker, Jeremy,

To be clear. This problem is not bothering us at all. We just found it and reported.

Now about FreeNAS box from which problem was caught: This FreeNAS box used in out QA process. As I have mentioned before I do not have access to this FreeNAS. Out admin this weekend left for vacation for 2 weeks. I have asked him to do level 10 log when he was in office. He said no. I think he did not like to mess with this FreeNAS box before vacation. 

Any case I do not have access. So you have to find way to setup environment Samba or FreeNAS somewhere. I can help with our box setup. 

Jeremy,

If you can bring some Samba/FreeNAS box with you then you are welcome to visit us any time. Just let me know when it convenient to you. Or if it can wait we can do tests during SDC Plugfest. 

Regards,
Max
Comment 9 Jeremy Allison 2015-09-08 21:04:15 UTC
(In reply to Max (LoadDynamix) from comment #8)

Max, I can certainly bring in a generic 'latest' Samba build on my Linux laptop, but can't guarantee it'll reproduce the problem. As SDC is only a few weeks away let's table this to the plugfest, and see if we can reproduce there.

Cheers,

Jeremy.
Comment 10 Max (LoadDynamix) 2015-09-08 21:54:08 UTC
Works for me.
Comment 11 Jeremy Allison 2015-09-23 03:00:35 UTC
Created attachment 11456 [details]
git-am fix for master
Comment 12 Jeremy Allison 2015-09-23 23:10:03 UTC
Created attachment 11459 [details]
Updated git-am patch for master

Adds Samba4 knownfail.
Comment 13 Jeremy Allison 2015-09-24 17:00:34 UTC
Created attachment 11464 [details]
git-am fix for 4.3.next, 4.2.next

Cherry-picked from master.
Comment 14 Jeremy Allison 2015-09-24 18:02:52 UTC
Reassigning to Karolin for inclusion in 4.3.next, 4.2.next.
Comment 15 Karolin Seeger 2015-10-05 07:19:46 UTC
(In reply to Jeremy Allison from comment #14)
Pushed to autobuild-v4-[3|2]-test.
Comment 16 Karolin Seeger 2015-10-12 18:46:34 UTC
(In reply to Karolin Seeger from comment #15)
Pushed to both branches.
Closing out bug report.

Thanks!