From 360aef6bb99dfc0804b59c7ab98bbc4d63d767cb Mon Sep 17 00:00:00 2001 From: Ralph Boehme Date: Wed, 29 Apr 2015 20:48:08 +0200 Subject: [PATCH] vfp_gpfs: ensure END_PROFILE is always called Bug: https://bugzilla.samba.org/show_bug.cgi?id=11244 Signed-off-by: Ralph Boehme --- source3/modules/vfs_gpfs.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/source3/modules/vfs_gpfs.c b/source3/modules/vfs_gpfs.c index 6ab17d5..a1912df 100644 --- a/source3/modules/vfs_gpfs.c +++ b/source3/modules/vfs_gpfs.c @@ -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; } -- 2.1.0