[Debian-ha-commits] [ocfs2-tools] 06/07: debian/patches: fixes for gcc warnings

Valentin Vidic vvidic-guest at moszumanska.debian.org
Mon Jul 10 11:54:50 UTC 2017


This is an automated email from the git hooks/post-receive script.

vvidic-guest pushed a commit to branch master
in repository ocfs2-tools.

commit 186e94b7205041d8c3be7a88d8b5ad0daa7a0c8a
Author: Valentin Vidic <Valentin.Vidic at CARNet.hr>
Date:   Mon Jul 10 13:23:33 2017 +0200

    debian/patches: fixes for gcc warnings
---
 debian/patches/fortify-source.patch            |  37 ++++++++
 debian/patches/gcc-warnings.patch              | 120 +++++++++++++++++++++++++
 debian/patches/register_printf_specifier.patch |  39 ++++++++
 debian/patches/series                          |   3 +
 4 files changed, 199 insertions(+)

diff --git a/debian/patches/fortify-source.patch b/debian/patches/fortify-source.patch
new file mode 100644
index 0000000..1139f79
--- /dev/null
+++ b/debian/patches/fortify-source.patch
@@ -0,0 +1,37 @@
+Description: Fix warnings reported by -D_FORTI FY_SOURCE=2
+Author: Valentin Vidic <Valentin.Vidic at CARNet.hr>
+Bug: https://github.com/markfasheh/ocfs2-tools/pull/16
+Last-Update: 2017-07-06
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+diff --git a/libocfs2/ismounted.c b/libocfs2/ismounted.c
+index 83b4d835..fcbdab60 100644
+--- a/libocfs2/ismounted.c
++++ b/libocfs2/ismounted.c
+@@ -257,7 +257,8 @@ static int is_swap_device(const char *file)
+ 	if (!(f = fopen("/proc/swaps", "r")))
+ 		return 0;
+ 	/* Skip the first line */
+-	fgets(buf, sizeof(buf), f);
++	if (!fgets(buf, sizeof(buf), f))
++		return 0;
+ 	while (!feof(f)) {
+ 		if (!fgets(buf, sizeof(buf), f))
+ 			break;
+diff --git a/mount.ocfs2/fstab.c b/mount.ocfs2/fstab.c
+index cea0f12d..d3fc6173 100644
+--- a/mount.ocfs2/fstab.c
++++ b/mount.ocfs2/fstab.c
+@@ -659,7 +659,11 @@ update_mtab (const char *dir, struct my_mntent *instead) {
+ 	   */
+ 	    struct stat sbuf;
+ 	    if (stat (MOUNTED, &sbuf) == 0)
+-		chown (MOUNTED_TEMP, sbuf.st_uid, sbuf.st_gid);
++		if (chown (MOUNTED_TEMP, sbuf.st_uid, sbuf.st_gid) < 0) {
++			int errsv = errno;
++			fprintf(stderr, _("error changing ownership of %s: %s\n"),
++				MOUNTED_TEMP, strerror (errsv));
++		}
+ 	}
+ 
+ 	/* rename mtemp to mtab */
diff --git a/debian/patches/gcc-warnings.patch b/debian/patches/gcc-warnings.patch
new file mode 100644
index 0000000..6c8f60f
--- /dev/null
+++ b/debian/patches/gcc-warnings.patch
@@ -0,0 +1,120 @@
+Description: Fix GCC 6 warnings
+Author: Valentin Vidic <Valentin.Vidic at CARNet.hr>
+Bug: https://github.com/markfasheh/ocfs2-tools/pull/13
+Last-Update: 2017-03-27
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+diff --git a/debugfs.ocfs2/commands.c b/debugfs.ocfs2/commands.c
+index 4e4ea7fd..1f31d5ca 100644
+--- a/debugfs.ocfs2/commands.c
++++ b/debugfs.ocfs2/commands.c
+@@ -1194,7 +1194,7 @@ static void do_logdump(char **args)
+ 	uint16_t slotnum;
+ 	uint64_t blkno;
+ 	FILE *out;
+-	int index = 1, traverse = 1;
++	int index = 1;
+ 	const char *logdump_usage = "usage: logdump [-T] <slot#>";
+ 
+ 	if (check_device_open())
+@@ -1206,7 +1206,6 @@ static void do_logdump(char **args)
+ 	}
+ 
+ 	if (!strncmp(args[index], "-T", 2)) {
+-		traverse = 0;
+ 		index++;
+ 	}
+ 
+diff --git a/fsck.ocfs2/xattr.c b/fsck.ocfs2/xattr.c
+index b0b03eda..d809f5fd 100644
+--- a/fsck.ocfs2/xattr.c
++++ b/fsck.ocfs2/xattr.c
+@@ -474,10 +474,9 @@ static uint16_t detect_xattr_bucket_count(char *bucket,
+ 	for (i = 0; i < max_buckets; i++) {
+ 		xh = (struct ocfs2_xattr_header *)bucket_buf;
+ 		if (xh->xh_count < max_count &&
+-		    xh->xh_free_start >
+-		    (xh->xh_count * ENTRY_SIZE &&
++		    xh->xh_free_start > xh->xh_count * ENTRY_SIZE &&
+ 		    xh->xh_free_start <= max_offset &&
+-		    xh->xh_name_value_len <= max_offset - xh->xh_free_start)) {
++		    xh->xh_name_value_len <= max_offset - xh->xh_free_start) {
+ 			bucket_buf += OCFS2_XATTR_BUCKET_SIZE;
+ 			continue;
+ 		} else
+diff --git a/libocfs2/refcount.c b/libocfs2/refcount.c
+index de1a07c5..5756844a 100644
+--- a/libocfs2/refcount.c
++++ b/libocfs2/refcount.c
+@@ -2229,20 +2229,20 @@ errcode_t ocfs2_detach_refcount_tree(ocfs2_filesys *fs,
+ 	if (!rb->rf_count) {
+ 		ret = ocfs2_delete_refcount_block(fs, rb->rf_blkno);
+ 		if (ret) {
+-			com_err("refcount", ret, "remove refcount tree <%lu> failed.\n", rb->rf_blkno);
++			com_err("refcount", ret, "remove refcount tree <%llu> failed.\n", rb->rf_blkno);
+ 			goto out;
+ 		}
+ 	} else {
+ 		ret = ocfs2_write_refcount_block(fs, refcount_loc, buf);
+ 		if (ret) {
+-			com_err("refcount", ret, "update refcount tree <%lu> failed.\n", rb->rf_blkno);
++			com_err("refcount", ret, "update refcount tree <%llu> failed.\n", rb->rf_blkno);
+ 			goto out;
+ 		}
+ 	}
+ 
+ 	ret = ocfs2_read_inode(fs, ino, buf);
+ 	if (ret) {
+-		com_err("refcount", ret, "read inode %lu fail, stop setting refcount tree <%lu>.\n",
++		com_err("refcount", ret, "read inode %lu fail, stop setting refcount tree <%llu>.\n",
+ 			ino, rb->rf_blkno);
+ 		goto out;
+ 	}
+diff --git a/libocfs2/truncate.c b/libocfs2/truncate.c
+index 2a142101..79e692aa 100644
+--- a/libocfs2/truncate.c
++++ b/libocfs2/truncate.c
+@@ -141,7 +141,7 @@ static int truncate_iterate(ocfs2_filesys *fs,
+ 				ret = ocfs2_delete_extent_block(fs, rec->e_blkno);
+ 				if (ret)
+ 					goto bail;
+-					cleanup_rec = 1;
++				cleanup_rec = 1;
+ 			}
+ 		}
+ 	}
+diff --git a/mkfs.ocfs2/mkfs.c b/mkfs.ocfs2/mkfs.c
+index f36d6372..354b2ee5 100644
+--- a/mkfs.ocfs2/mkfs.c
++++ b/mkfs.ocfs2/mkfs.c
+@@ -914,6 +914,8 @@ get_state(int argc, char **argv)
+ 
+ 	if (argc && *argv)
+ 		progname = basename(argv[0]);
++	else
++		progname = "mkfs.ocfs2";
+ 
+ 	while (1) {
+ 		c = getopt_long(argc, argv, "b:C:L:N:J:M:vnqVFHxT:U:",
+diff --git a/o2cb_ctl/jconfig.c b/o2cb_ctl/jconfig.c
+index 0cb90d1b..b080ed5d 100644
+--- a/o2cb_ctl/jconfig.c
++++ b/o2cb_ctl/jconfig.c
+@@ -1084,7 +1084,7 @@ JConfigStanza *j_config_add_stanza(JConfig *cf,
+                             elem);
+     }
+     else
+-        g_list_append(elem, cfs);
++        elem = g_list_append(elem, cfs);
+ 
+     return(cfs);
+ }  /* j_config_add_stanza() */
+@@ -1408,7 +1408,7 @@ JIterator *j_config_get_stanzas(JConfig *cf,
+                 }
+                 else
+                 {
+-                    if (matches[i].value != '\0')
++                    if (matches[i].value != NULL)
+                         break;
+                 }
+             }
diff --git a/debian/patches/register_printf_specifier.patch b/debian/patches/register_printf_specifier.patch
new file mode 100644
index 0000000..b38a384
--- /dev/null
+++ b/debian/patches/register_printf_specifier.patch
@@ -0,0 +1,39 @@
+Description: Fix GCC 6 warnings
+Author: Valentin Vidic <Valentin.Vidic at CARNet.hr>
+Bug: https://github.com/markfasheh/ocfs2-tools/pull/13
+Last-Update: 2017-06-26
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+--- a/tunefs.ocfs2/op_query.c
++++ b/tunefs.ocfs2/op_query.c
+@@ -324,19 +324,19 @@
+ 		return 1;
+ 	}
+ 
+-	register_printf_function('B', handle_blocksize, handle_arginfo);
+-	register_printf_function('T', handle_clustersize, handle_arginfo);
+-	register_printf_function('N', handle_numslots, handle_arginfo);
+-	register_printf_function('R', handle_rootdir, handle_arginfo);
+-	register_printf_function('Y', handle_sysdir, handle_arginfo);
+-	register_printf_function('P', handle_clustergroup, handle_arginfo);
++	register_printf_specifier('B', handle_blocksize, handle_arginfo);
++	register_printf_specifier('T', handle_clustersize, handle_arginfo);
++	register_printf_specifier('N', handle_numslots, handle_arginfo);
++	register_printf_specifier('R', handle_rootdir, handle_arginfo);
++	register_printf_specifier('Y', handle_sysdir, handle_arginfo);
++	register_printf_specifier('P', handle_clustergroup, handle_arginfo);
+ 
+-	register_printf_function('V', handle_label, handle_arginfo);
+-	register_printf_function('U', handle_uuid, handle_arginfo);
++	register_printf_specifier('V', handle_label, handle_arginfo);
++	register_printf_specifier('U', handle_uuid, handle_arginfo);
+ 
+-	register_printf_function('M', handle_compat, handle_arginfo);
+-	register_printf_function('H', handle_incompat, handle_arginfo);
+-	register_printf_function('O', handle_ro_compat, handle_arginfo);
++	register_printf_specifier('M', handle_compat, handle_arginfo);
++	register_printf_specifier('H', handle_incompat, handle_arginfo);
++	register_printf_specifier('O', handle_ro_compat, handle_arginfo);
+ 
+ 	query_fs = fs;
+ 	fprintf(stdout, fmt);
diff --git a/debian/patches/series b/debian/patches/series
index 54f73aa..0638241 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -4,3 +4,6 @@ o2cb-init-script.patch
 dead_threshold.patch
 systemd-service.patch
 parallel-build.patch
+gcc-warnings.patch
+register_printf_specifier.patch
+fortify-source.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-ha/ocfs2-tools.git



More information about the Debian-HA-Commits mailing list