]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: VFS: syncops. Do early return in syncops_renameat().
authorJeremy Allison <jra@samba.org>
Thu, 17 Jun 2021 19:16:58 +0000 (12:16 -0700)
committerNoel Power <npower@samba.org>
Tue, 22 Jun 2021 13:44:34 +0000 (13:44 +0000)
Makes the code path clearer.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
source3/modules/vfs_syncops.c

index 09b270d091836e5c9a57acca2e1fa327577c2ee0..bc8b641c1b0833666fb8889b2bd2790c90581d43 100644 (file)
@@ -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;
 }