cluster: RHEL6 - gfs2_edit: Ensure all leaf blocks in per_node are saved

Andrew Price andyp at fedoraproject.org
Fri Jun 6 15:38:37 UTC 2014


Gitweb:        http://git.fedorahosted.org/git/?p=cluster.git;a=commitdiff;h=84b78a126085a34fc4b7bf39911431b5993bb221
Commit:        84b78a126085a34fc4b7bf39911431b5993bb221
Parent:        961deb270edfe04820e6c3bf75c949690e0d03de
Author:        Andrew Price <anprice at redhat.com>
AuthorDate:    Thu Jun 5 01:41:13 2014 +0100
Committer:     Andrew Price <anprice at redhat.com>
CommitterDate: Fri Jun 6 16:34:53 2014 +0100

gfs2_edit: Ensure all leaf blocks in per_node are saved

block_is_in_per_node() only checks the first leaf block when the
per_node directory has been split (when the block size is small and/or
the number of journals is large). This caused savemeta to treat the
files in per_node as user data and so didn't save their metadata. Add an
outer loop to iterate over the indirect blocks.

Resolves: rhbz#1081523

Signed-off-by: Andrew Price <anprice at redhat.com>
---
 gfs2/edit/hexedit.c |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/gfs2/edit/hexedit.c b/gfs2/edit/hexedit.c
index c3a450b3..d275069 100644
--- a/gfs2/edit/hexedit.c
+++ b/gfs2/edit/hexedit.c
@@ -1672,7 +1672,7 @@ int block_is_per_node(void)
 /* ------------------------------------------------------------------------ */
 int block_is_in_per_node(void)
 {
-	int d;
+	int i;
 	struct gfs2_inode *per_node_di;
 
 	if (sbd.gfs1)
@@ -1683,9 +1683,12 @@ int block_is_in_per_node(void)
 	do_dinode_extended(&per_node_di->i_di, per_node_di->i_bh);
 	inode_put(&per_node_di);
 
-	for (d = 0; d < indirect->ii[0].dirents; d++) {
-		if (block == indirect->ii[0].dirent[d].block)
-			return TRUE;
+	for (i = 0; i < indirect_blocks; i++) {
+		int d;
+		for (d = 0; d < indirect->ii[i].dirents; d++) {
+			if (block == indirect->ii[i].dirent[d].block)
+				return TRUE;
+		}
 	}
 	return FALSE;
 }


More information about the cluster-commits mailing list