[dpm-dsi/el6] Patch for the FTS2 issue

MIchal Simon simonm at fedoraproject.org
Fri May 23 17:47:46 UTC 2014


commit 8a29988f062686654fc71b6c58a1f508b862cd31
Author: simonm <michal.simon at cern.ch>
Date:   Fri May 23 19:47:19 2014 +0200

    Patch for the FTS2 issue

 dpm-dsi-fts2_issue.patch |   75 ++++++++++++++++++++++++++++++++++++++++++++++
 dpm-dsi.spec             |   23 +++++++++++--
 2 files changed, 94 insertions(+), 4 deletions(-)
---
diff --git a/dpm-dsi-fts2_issue.patch b/dpm-dsi-fts2_issue.patch
new file mode 100644
index 0000000..18ae0bc
--- /dev/null
+++ b/dpm-dsi-fts2_issue.patch
@@ -0,0 +1,75 @@
+Index: src/dmlite_internal.c
+===================================================================
+--- src/dmlite_internal.c	(.../tags/dpm-dsi_1_9_3d)	(revision 10465)
++++ src/dmlite_internal.c	(.../trunk)	(revision 10465)
+@@ -399,7 +399,7 @@
+ 		dmlite_handle_obj->is_replica = GLOBUS_TRUE;
+ 		dmlite_query = dmlite_location_obj->chunks[0].url.query;
+ 	} else if (local || dmlite_errno(dmlite_context_obj) == ENOENT) {
+-		if (dmlite_accessr(dmlite_context_obj, rfn, mode)) {
++		if (!(flags & O_INSECURE) && dmlite_accessr(dmlite_context_obj, rfn, mode)) {
+ 			dmlite_gfs_log(dmlite_handle_obj, GLOBUS_GFS_LOG_ERR, "access to RFN denied :: %s :: %s",
+ 					rfn, dmlite_error(dmlite_context_obj));
+ 			goto errout;
+Index: src/dmlite_gridftp.c
+===================================================================
+--- src/dmlite_gridftp.c	(.../tags/dpm-dsi_1_9_3d)	(revision 10465)
++++ src/dmlite_gridftp.c	(.../trunk)	(revision 10465)
+@@ -178,13 +178,14 @@
+ 	struct dmlite_xstat	dmlite_xstat_obj;
+ 	struct dmlite_dir *	dir_fd;
+ 	struct dmlite_xstat *	dir_entry_xstat;
++	struct stat		tmpstat;
+ 	int			nfiles, ctx_err;
+ 	const char *		localpath = dmlite_gfs_fixpath(stat_info->pathname, GLOBUS_FALSE);
+ 	const char *		rfn = dmlite_gfs_fixpath(stat_info->pathname, GLOBUS_TRUE);
+ 
+ 	GlobusGFSName(globus_l_gfs_dmlite_stat);
+ 
+-	dmlite_gfs_log(dmlite_handle_obj, GLOBUS_GFS_LOG_INFO, "stat :: %s", localpath);
++	dmlite_gfs_log(dmlite_handle_obj, GLOBUS_GFS_LOG_INFO, "stat :: %s", stat_info->pathname);
+ 
+ 	/* Get a dmlite_context object */
+ 	dmlite_context_obj = dmlite_get_context(dmlite_handle_obj, &ctx_err);
+@@ -211,7 +212,31 @@
+ finstat:
+ 	/* File like info on the entry is easy to handle */
+ 	if (!S_ISDIR(dmlite_xstat_obj.stat.st_mode) || stat_info->file_only) {
+-		dmlite_gfs_log(NULL, GLOBUS_GFS_LOG_INFO, "stat :: %s :: entry info only", localpath);
++		dmlite_gfs_log(NULL, GLOBUS_GFS_LOG_INFO, "stat :: single entry");
++		/* Workaround for partially written replicas */
++		if (dmlite_xstat_obj.stat.st_size != 0)
++			goto giveup;
++		dmlite_gfs_log(NULL, GLOBUS_GFS_LOG_WARN, "stat :: zero size replica");
++		if (dmlite_handle_obj->fd) {
++			/* Ignore this error */
++			posix_error2gfs_result(_gfs_name, dmlite_handle_obj, EINVAL, "session already has a file open");
++			goto giveup;
++		}
++		if (!dmlite_gfs_open(dmlite_context_obj, dmlite_handle_obj, rfn, O_RDONLY | O_INSECURE)) {
++			/* Ignore this error */
++			dmlite_error2gfs_result(_gfs_name, dmlite_handle_obj, dmlite_context_obj);
++			goto giveup;
++		}
++		if (dmlite_fstat(dmlite_handle_obj->fd, &tmpstat)) {
++			/* Ignore this error */
++			dmlite_error2gfs_result(_gfs_name, dmlite_handle_obj, dmlite_context_obj);
++			dmlite_gfs_close(NULL, dmlite_handle_obj, 0);
++			goto giveup;
++		}
++		dmlite_xstat_obj.stat.st_size = tmpstat.st_size;
++		dmlite_gfs_log(NULL, GLOBUS_GFS_LOG_WARN, "stat :: actual file size is %lld", tmpstat.st_size);
++		dmlite_gfs_close(NULL, dmlite_handle_obj, 0);
++giveup:
+ 		/* Allocate the stat array */
+ 		gfs_stat_array = (globus_gfs_stat_t *)globus_malloc(sizeof(globus_gfs_stat_t));
+ 		if (!gfs_stat_array) {
+@@ -222,7 +247,7 @@
+ 		stat_count = 1;
+ 	} else { /* Going through directory is a bit more work */
+ 		nfiles  = dmlite_xstat_obj.stat.st_nlink;
+-		dmlite_gfs_log(NULL, GLOBUS_GFS_LOG_INFO, "stat :: %s :: full dir info with %d files", localpath, nfiles);
++		dmlite_gfs_log(NULL, GLOBUS_GFS_LOG_INFO, "stat :: full directory with %d files", nfiles);
+ 
+ 		/* Allocate the stat array */
+ 		gfs_stat_array = (globus_gfs_stat_t *)globus_malloc(sizeof(globus_gfs_stat_t) * nfiles);
diff --git a/dpm-dsi.spec b/dpm-dsi.spec
index d9883cc..cb4a063 100644
--- a/dpm-dsi.spec
+++ b/dpm-dsi.spec
@@ -1,7 +1,7 @@
 Name:		dpm-dsi
 Summary:	Disk Pool Manager (DPM) plugin for the Globus GridFTP server
 Version:	1.9.3
-Release:	2%{?dist}
+Release:	3%{?dist}
 License:	ASL 2.0
 Group:		Applications/Internet
 URL:		https://svnweb.cern.ch/trac/lcgdm/wiki/Dpm
@@ -12,6 +12,7 @@ URL:		https://svnweb.cern.ch/trac/lcgdm/wiki/Dpm
 Source0:	%{name}-%{version}.tar.gz
 # https://its.cern.ch/jira/browse/LCGDM-1408
 Patch0:   dpm-dsi-eof.patch
+Patch1:   dpm-dsi-fts2_issue.patch 
 Buildroot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 BuildRequires:		cmake
@@ -47,6 +48,7 @@ required to expose the data using this protocol.
 %prep
 %setup -q -n %{name}-%{version}
 %patch0 -p0
+%patch1 -p0
 
 %build
 %cmake . -DCMAKE_INSTALL_PREFIX=/
@@ -88,16 +90,29 @@ if [ $1 -ge 1 ]; then
 fi
 
 %changelog
+* Fri May 23 2014 Michal Simon <michal.simon at cern.ch> - 1.9.3-3
+- Patch for the FTS2 issue 
+
 * Thu May 15 2014 Alejandro Alvarez <aalvarez at cern.ch> - 1.9.3-2
 - Patch for proper EOF handling
 
 * Wed Mar 12 2014 Alejandro Alvarez <aalvarez at cern.ch> - 1.9.3-1
 - Update for new upstream release
-
-* Wed Jul 17 2013 Alejandro Alvarez <aalvarez at cern.ch> - 1.8.4-1
-- Update to new upstream release 1.8.4
 - Fixed bogus date
 
+* Sat Aug 03 2013 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 1.9.0-4
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
+
+* Mon May 06 2013 Alejandro Alvarez <aalvarez at cern.ch> - 1.9.0-3
+- Removed devel package
+- Removed %{?_isa} suffix from globus-gridftp-server-progs
+
+* Wed Feb 13 2013 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 1.9.0-2
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
+
+* Wed Dec 19 2012 Ricardo Rocha <ricardo.rocha at cern.ch> - 1.9.0-1
+- Update for new upstream release
+
 * Fri Dec 14 2012 Ricardo Rocha <ricardo.rocha at cern.ch> - 1.8.3-1
 - Update to new upstream release
 - Removed previously required patches (integrated upstream)


More information about the scm-commits mailing list