Commit - 405d1164 smbd: open a pathref fsp on the parent directory adds a TALLOC_FREE() call which clears out the errno required by the subsequent map_nt_error_from_unix() call. The errno is possibly cleared by a destructor called by the TALLOC_FREE(). This results in an incorrect nt_status being returned.
This is causing failures in smb2.create.mkdir-dup with glusterfs as the backing fs.
Fix this by calling map_nt_error_from_unix(errno) before the TALLOC_FREE() call is made.
I have tested this patch using smbtorture smb2.create.mkdir-dup test with glusterfs as the backend filesystem for both replicate and disperse volumes.
BZ: https://bugzilla.samba.org/show_bug.cgi?id=14662
Edit: Add BZ
Checklist
-
Commits have Signed-off-by:
with name/author being identical to the commit author -
(optional) This MR is just one part towards a larger feature. -
(optional, if backport required) Bugzilla bug filed and BUG:
tag added -
Test suite updated with functionality tests -
Test suite updated with negative tests -
Documentation updated -
CI timeout is 3h or higher (see Settings/CICD/General pipelines/ Timeout)
Reviewer's checklist:
-
There is a test suite reasonably covering new functionality or modifications -
Function naming, parameters, return values, types, etc., are consistent and according to README.Coding.md
-
This feature/change has adequate documentation added -
No obvious mistakes in the code