From: Jeremy Allison Date: Thu, 17 Jun 2021 19:16:58 +0000 (-0700) Subject: s3: VFS: syncops. Do early return in syncops_renameat(). X-Git-Tag: tevent-0.11.0~232 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=abc210943d8d29bff10eaa78bb60de6a05f297ba;p=thirdparty%2Fsamba.git s3: VFS: syncops. Do early return in syncops_renameat(). Makes the code path clearer. Signed-off-by: Jeremy Allison Reviewed-by: Noel Power --- diff --git a/source3/modules/vfs_syncops.c b/source3/modules/vfs_syncops.c index 09b270d0918..bc8b641c1b0 100644 --- a/source3/modules/vfs_syncops.c +++ b/source3/modules/vfs_syncops.c @@ -155,11 +155,19 @@ static int syncops_renameat(vfs_handle_struct *handle, smb_fname_src, dstfsp, smb_fname_dst); - if (ret == 0 && config->onmeta && !config->disable) { - syncops_two_names(handle->conn, - smb_fname_src, - smb_fname_dst); + if (ret == -1) { + return ret; + } + if (config->disable) { + return ret; } + if (!config->onmeta) { + return ret; + } + + syncops_two_names(handle->conn, + smb_fname_src, + smb_fname_dst); return ret; }