vfp_gpfs: ensure END_PROFILE is always called
authorRalph Boehme <slow@samba.org>
Wed, 29 Apr 2015 18:48:08 +0000 (20:48 +0200)
committerKarolin Seeger <kseeger@samba.org>
Wed, 20 May 2015 12:10:34 +0000 (14:10 +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

(cherry picked from commit 5e65ae14ddb74c648f31b4dfbacd4af9c02ca058)

source3/modules/vfs_gpfs.c

index e1e29fa2edd0f5bda44a5d0bb7e6ba7a4e03d6ee..9d329ccc97d139cc16bcdcb1591789f9474314e0 100644 (file)
@@ -78,8 +78,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);
@@ -98,6 +96,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)) {
@@ -131,14 +131,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) {
                /*
@@ -152,6 +154,7 @@ static int vfs_gpfs_setlease(vfs_handle_struct *handle, files_struct *fsp,
 
        END_PROFILE(syscall_linux_setlease);
 
+failure:
        return ret;
 }