[PATCH] s3:modules/vfs_gpfs add gpfs:recalls option

Christof Schmitt cs at samba.org
Thu Mar 13 10:38:44 MDT 2014


This patch adds a gpfs:recalls option that can be used to prevent
recalls of files from HSM.

Christof
-------------- next part --------------
>From 38bf9beaf25b42157414ec13ac63814143a7b43f Mon Sep 17 00:00:00 2001
From: Christian Ambach <ambi at samba.org>
Date: Wed, 20 Mar 2013 15:16:37 +0100
Subject: [PATCH 1/2] s3:modules/vfs_gpfs add gpfs:recalls option

When this option is set to no, an attempt to open an offline file will
be rejected with access denied.  This helps preventing recall storms
triggered by careless applications like Finder and Explorer.

Signed-off-by: Christian Ambach <ambi at samba.org>
Reviewed-by: Christof Schmitt <cs at samba.org>
---
 source3/modules/vfs_gpfs.c |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/source3/modules/vfs_gpfs.c b/source3/modules/vfs_gpfs.c
index 760d27f..73ab4a4 100644
--- a/source3/modules/vfs_gpfs.c
+++ b/source3/modules/vfs_gpfs.c
@@ -49,6 +49,7 @@ struct gpfs_config_data {
 	bool prealloc;
 	bool acl;
 	bool settimes;
+	bool recalls;
 };
 
 
@@ -1810,6 +1811,8 @@ static int vfs_gpfs_connect(struct vfs_handle_struct *handle,
 
 	config->settimes = lp_parm_bool(SNUM(handle->conn), "gpfs",
 					"settimes", true);
+	config->recalls = lp_parm_bool(SNUM(handle->conn), "gpfs",
+				       "recalls", true);
 
 	SMB_VFS_HANDLE_SET_DATA(handle, config,
 				NULL, struct gpfs_config_data,
@@ -2015,6 +2018,16 @@ static int vfs_gpfs_open(struct vfs_handle_struct *handle,
 				struct gpfs_config_data,
 				return -1);
 
+	if (config->hsm && !config->recalls) {
+		if (VALID_STAT(smb_fname->st) &&
+		    (smb_fname->st.vfs_private & GPFS_WINATTR_OFFLINE)) {
+			DEBUG(10, ("Refusing access to offline file %s\n",
+				  fsp_str_dbg(fsp)));
+			errno = EACCES;
+			return -1;
+		}
+	}
+
 	if (config->syncio) {
 		flags |= O_SYNC;
 	}
-- 
1.7.1

-------------- next part --------------
>From f9c7ff241df8ec7702bf6b5e63027285383c4d96 Mon Sep 17 00:00:00 2001
From: Christof Schmitt <cs at samba.org>
Date: Thu, 13 Mar 2014 09:26:44 -0700
Subject: [PATCH 2/2] docs: Add gpfs:recalls parameter to vfs_gpfs manpage

Signed-off-by: Christof Schmitt <cs at samba.org>
---
 docs-xml/manpages/vfs_gpfs.8.xml |   22 ++++++++++++++++++++++
 1 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/docs-xml/manpages/vfs_gpfs.8.xml b/docs-xml/manpages/vfs_gpfs.8.xml
index 4ba1b25..3fb9896 100644
--- a/docs-xml/manpages/vfs_gpfs.8.xml
+++ b/docs-xml/manpages/vfs_gpfs.8.xml
@@ -138,6 +138,28 @@
 		</varlistentry>
 
 		<varlistentry>
+		<term>gpfs:recalls = [ yes | no ]</term>
+		<listitem>
+		<para> When this option is set to no, an attempt to
+		open an offline file will be rejected with access
+		denied.  This helps preventing recall storms triggered
+		by careless applications like Finder and
+		Explorer.</para>
+
+		<itemizedlist>
+		<listitem><para><command>yes(default)</command> - Open
+		files that are offline. This will recall the files
+		from HSM.</para></listitem>
+		<listitem><para><command>no</command> - Reject access
+		to offline files with access denied. This will prevent
+		recalls of files from HSM. Using this setting also
+		requires gpfs:hsm to be set to yes.</para></listitem>
+		</itemizedlist>
+
+		</listitem>
+		</varlistentry>
+
+		<varlistentry>
 
 		<term>gpfs:getrealfilename = [ yes | no ]</term>
 		<listitem>
-- 
1.7.1



More information about the samba-technical mailing list