summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2019-05-27 17:03:38 +0200
committerJeremy Allison <jra@samba.org>2019-06-20 17:18:18 +0000
commitf0a9459e66b93ba7b231aa6c0edc5270e0c13f55 (patch)
tree21cecd678cfc3bf8301b0fe7cbadf60e15b10d2e
parent67f89bb3300a4cedd2bb01f81a6ede21b05377e0 (diff)
downloadsamba-f0a9459e66b93ba7b231aa6c0edc5270e0c13f55.tar.gz
smbd: Slightly simplify smbd_smb2_lock_send()
For unlocking we don't need the error mapping, do an early return Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
-rw-r--r--source3/smbd/smb2_lock.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/source3/smbd/smb2_lock.c b/source3/smbd/smb2_lock.c
index e1df44bb373..d2d8f0adf34 100644
--- a/source3/smbd/smb2_lock.c
+++ b/source3/smbd/smb2_lock.c
@@ -350,15 +350,17 @@ static struct tevent_req *smbd_smb2_lock_send(TALLOC_CTX *mem_ctx,
if (isunlock) {
status = smbd_do_unlocking(
smb1req, fsp, in_lock_count, locks, WINDOWS_LOCK);
- async = false;
- } else {
- status = smbd_do_locking(smb1req,
- fsp,
- timeout,
- in_lock_count,
- locks,
- &async);
+
+ if (tevent_req_nterror(req, status)) {
+ return tevent_req_post(req, ev);
+ }
+ tevent_req_done(req);
+ return tevent_req_post(req, ev);
}
+
+ status = smbd_do_locking(
+ smb1req, fsp, timeout, in_lock_count, locks, &async);
+
if (!NT_STATUS_IS_OK(status)) {
if (NT_STATUS_EQUAL(status, NT_STATUS_FILE_LOCK_CONFLICT)) {
status = NT_STATUS_LOCK_NOT_GRANTED;