1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-03 13:47:25 +03:00

smbd: Simplify reopen_from_fsp() with an early return

Review with git show -b

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
Volker Lendecke 2021-12-30 15:59:33 +01:00 committed by Jeremy Allison
parent 1d6762d86b
commit e93f46357f

View File

@ -1227,25 +1227,25 @@ static NTSTATUS reopen_from_fsp(struct files_struct *fsp,
status = reopen_from_procfd(fsp,
flags,
mode);
if (NT_STATUS_EQUAL(status, NT_STATUS_MORE_PROCESSING_REQUIRED)) {
/*
* Close the existing pathref fd and set the fsp flag
* is_pathref to false so we get a "normal" fd this
* time.
*/
status = fd_close(fsp);
if (!NT_STATUS_IS_OK(status)) {
return status;
}
fsp->fsp_flags.is_pathref = false;
status = fd_open_atomic(fsp,
flags,
mode,
p_file_created);
if (!NT_STATUS_EQUAL(status, NT_STATUS_MORE_PROCESSING_REQUIRED)) {
return status;
}
/*
* Close the existing pathref fd and set the fsp flag
* is_pathref to false so we get a "normal" fd this time.
*/
status = fd_close(fsp);
if (!NT_STATUS_IS_OK(status)) {
return status;
}
fsp->fsp_flags.is_pathref = false;
status = fd_open_atomic(fsp,
flags,
mode,
p_file_created);
return status;
}