Thread (16 messages) 16 messages, 2 authors, 2016-08-25

Re: [PATCH 5/7] misc: fix Coverity errors

From: Christoph Hellwig <hch@infradead.org>
Date: 2016-08-25 09:15:03

On Tue, Aug 23, 2016 at 07:24:56PM -0700, Darrick J. Wong wrote:
Fix various code sloppinesses pointed out by Coverity.

Coverity-id: 1371628 - 1371638
quoted hunk ↗ jump to hunk
@@ -75,6 +75,7 @@ fsmap(
 	high.rm_owner = ULLONG_MAX;
 	high.rm_offset = ULLONG_MAX;
 	high.rm_flags = XFS_RMAP_ATTR_FORK | XFS_RMAP_BMBT_BLOCK | XFS_RMAP_UNWRITTEN;
+	high.rm_blockcount = low.rm_blockcount = 0;
Do the low initialization near the remaining low fields?

or better do a struct initialization ala

	struct xfs_rmap_irec low = { 0, };
	struct xfs_rmap_irec high = { 0, };

that ensures the who;le structure is zero-filled for uninitialized
fields.
quoted hunk ↗ jump to hunk
diff --git a/repair/phase5.c b/repair/phase5.c
index e583879..5a7185c 100644
--- a/repair/phase5.c
+++ b/repair/phase5.c
@@ -1464,7 +1464,7 @@ prop_rmap_cursor(
 		 * and set the rightsib pointer of current block
 		 */
 #ifdef XR_BLD_INO_TRACE
-		fprintf(stderr, " ino prop agbno %d ", lptr->prev_agbno);
+		fprintf(stderr, " rmap prop agbno %d ", lptr->prev_agbno);
 #endif
Did Coveryity really point this out? :)
quoted hunk ↗ jump to hunk
@@ -1548,6 +1548,7 @@ prop_rmap_highkey(
 		bt_key->rm_offset = cpu_to_be64(
 				libxfs_rmap_irec_offset_pack(&high_key));
 
+		key.rm_blockcount = 0;
should probably be a struct initializer again

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help