vfp_gpfs: ensure END_PROFILE is always called
authorRalph Boehme <slow@samba.org>
Wed, 29 Apr 2015 18:48:08 +0000 (20:48 +0200)
committerRalph Böhme <slow@samba.org>
Thu, 30 Apr 2015 17:34:41 +0000 (19:34 +0200)
Bug: https://bugzilla.samba.org/show_bug.cgi?id=11244

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Thu Apr 30 19:34:41 CEST 2015 on sn-devel-104

source3/modules/vfs_gpfs.c

index 6ab17d5026b8ef4d27f47f8430b48e87c44688f5..a1912df174da3db00ccdc275f53ad4a298d8be4d 100644 (file)
@@ -125,8 +125,6 @@ static int vfs_gpfs_kernel_flock(vfs_handle_struct *handle, files_struct *fsp,
        struct gpfs_config_data *config;
        int ret = 0;
 
-       START_PROFILE(syscall_kernel_flock);
-
        SMB_VFS_HANDLE_GET_DATA(handle, config,
                                struct gpfs_config_data,
                                return -1);
@@ -145,6 +143,8 @@ static int vfs_gpfs_kernel_flock(vfs_handle_struct *handle, files_struct *fsp,
                return 0;
        }
 
+       START_PROFILE(syscall_kernel_flock);
+
        kernel_flock(fsp->fh->fd, share_mode, access_mask);
 
        if (!set_gpfs_sharemode(fsp, access_mask, fsp->share_access)) {
@@ -198,14 +198,16 @@ static int vfs_gpfs_setlease(vfs_handle_struct *handle, files_struct *fsp,
        struct gpfs_config_data *config;
        int ret=0;
 
-       START_PROFILE(syscall_linux_setlease);
-
        SMB_VFS_HANDLE_GET_DATA(handle, config,
                                struct gpfs_config_data,
                                return -1);
 
-       if (linux_set_lease_sighandler(fsp->fh->fd) == -1)
-               return -1;
+       START_PROFILE(syscall_linux_setlease);
+
+       if (linux_set_lease_sighandler(fsp->fh->fd) == -1) {
+               ret = -1;
+               goto failure;
+       }
 
        if (config->leases) {
                /*
@@ -219,6 +221,7 @@ static int vfs_gpfs_setlease(vfs_handle_struct *handle, files_struct *fsp,
 
        END_PROFILE(syscall_linux_setlease);
 
+failure:
        return ret;
 }