[PATCH] Fixes for vfs_gpfs.c

Volker Lendecke Volker.Lendecke at SerNet.DE
Thu Nov 5 13:17:33 UTC 2015


Hi!

Review&push appreciated!

Thanks,

Volker

-- 
SerNet GmbH, Bahnhofsallee 1b, 37081 Göttingen
phone: +49-551-370000-0, fax: +49-551-370000-9
AG Göttingen, HRB 2816, GF: Dr. Johannes Loxen
http://www.sernet.de, mailto:kontakt at sernet.de

Besuchen Sie uns vom 10.-11.11.15 auf der ISSE!
Information Security Solutions Europe Conference
Hotel Palace Berlin, 20%-Rabattcode: "ISSE15SP"

Meet us at Information Security Conference ISSE!
November 10th - 11th 2015 in Hotel Palace Berlin
For 20% discount take voucher code:  "ISSE15SP"
-------------- next part --------------
From 7b245e0bff6d4a0af836be548bb83032dfe59019 Mon Sep 17 00:00:00 2001
From: Volker Lendecke <vl at samba.org>
Date: Thu, 5 Nov 2015 13:35:23 +0100
Subject: [PATCH 1/2] vfs_gpfs: Fix the build with
 -Werror=declaration-after-statement

Signed-off-by: Volker Lendecke <vl at samba.org>
---
 source3/modules/vfs_gpfs.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/source3/modules/vfs_gpfs.c b/source3/modules/vfs_gpfs.c
index ee4c1f6..22b1b30 100644
--- a/source3/modules/vfs_gpfs.c
+++ b/source3/modules/vfs_gpfs.c
@@ -126,6 +126,8 @@ 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);
@@ -144,8 +146,6 @@ 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)) {
@@ -199,12 +199,12 @@ 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);
 
-	START_PROFILE(syscall_linux_setlease);
-
 	if (linux_set_lease_sighandler(fsp->fh->fd) == -1) {
 		ret = -1;
 		goto failure;
-- 
1.7.9.5


From ddbd9313a15203df4d8adbdb217749a56f8c3d6b Mon Sep 17 00:00:00 2001
From: Volker Lendecke <vl at samba.org>
Date: Thu, 5 Nov 2015 13:22:33 +0100
Subject: [PATCH 2/2] vfs_gpfs: Re-enable share modes

is_ntfs_default_stream_smb_fname returns false for a NULL stream name, so for
streamless filenames we do not set gpfs share modes without this patch.

Signed-off-by: Volker Lendecke <vl at samba.org>
---
 source3/modules/vfs_gpfs.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/source3/modules/vfs_gpfs.c b/source3/modules/vfs_gpfs.c
index 22b1b30..dc53da0 100644
--- a/source3/modules/vfs_gpfs.c
+++ b/source3/modules/vfs_gpfs.c
@@ -141,7 +141,8 @@ static int vfs_gpfs_kernel_flock(vfs_handle_struct *handle, files_struct *fsp,
 	 * fd, so lacking a distinct fd for the stream we have to skip
 	 * kernel_flock and set_gpfs_sharemode for stream.
 	 */
-	if (!is_ntfs_default_stream_smb_fname(fsp->fsp_name)) {
+	if (is_ntfs_stream_smb_fname(fsp->fsp_name) &&
+	    !is_ntfs_default_stream_smb_fname(fsp->fsp_name)) {
 		DEBUG(2,("%s: kernel_flock on stream\n", fsp_str_dbg(fsp)));
 		return 0;
 	}
-- 
1.7.9.5



More information about the samba-technical mailing list