Blame SOURCES/bz1487726-6-fsck_gfs2_Retain_context_for_indirect_pointers_in_check_metalist.patch

9257a6
commit 5cf083a5c231bfe0950a276aff9249dd63f708d3
9257a6
Author: Andrew Price <anprice@redhat.com>
9257a6
Date:   Fri Oct 18 19:16:08 2019 +0100
9257a6
9257a6
    fsck.gfs2: Retain context for indirect pointers in ->check_metalist
9257a6
    
9257a6
    When the pass->check_metalist() functions are called, the pointer is
9257a6
    thrown away and the function is just called with a block address,
9257a6
    meaning that ->check_metalist() is unable to fix the pointer itself if
9257a6
    it deems the block pointed to is garbage.
9257a6
    
9257a6
    Add an iptr structure which collects together the inode, the metadata
9257a6
    block buffer and the offset of the pointer in that buffer. The iptr is
9257a6
    now passed to ->check_metadata instead of the separate inode and block
9257a6
    address arguments.
9257a6
    
9257a6
    Resolves: rhbz#1487726
9257a6
    
9257a6
    Signed-off-by: Andrew Price <anprice@redhat.com>
9257a6
9257a6
diff --git a/gfs2/fsck/afterpass1_common.c b/gfs2/fsck/afterpass1_common.c
9257a6
index b7476408..55a6c76b 100644
9257a6
--- a/gfs2/fsck/afterpass1_common.c
9257a6
+++ b/gfs2/fsck/afterpass1_common.c
9257a6
@@ -175,10 +175,12 @@ int remove_dentry_from_dir(struct gfs2_sbd *sdp, uint64_t dir,
9257a6
 	return error;
9257a6
 }
9257a6
 
9257a6
-int delete_metadata(struct gfs2_inode *ip, uint64_t block,
9257a6
-		    struct gfs2_buffer_head **bh, int h, int *is_valid,
9257a6
+int delete_metadata(struct iptr iptr, struct gfs2_buffer_head **bh, int h, int *is_valid,
9257a6
 		    int *was_duplicate, void *private)
9257a6
 {
9257a6
+	struct gfs2_inode *ip = iptr.ipt_ip;
9257a6
+	uint64_t block = iptr_block(iptr);
9257a6
+
9257a6
 	*is_valid = 1;
9257a6
 	*was_duplicate = 0;
9257a6
 	return delete_block_if_notdup(ip, block, bh, _("metadata"),
9257a6
diff --git a/gfs2/fsck/afterpass1_common.h b/gfs2/fsck/afterpass1_common.h
9257a6
index 829828f7..74b913f3 100644
9257a6
--- a/gfs2/fsck/afterpass1_common.h
9257a6
+++ b/gfs2/fsck/afterpass1_common.h
9257a6
@@ -2,9 +2,9 @@
9257a6
 #define _AFTERPASS1_H
9257a6
 
9257a6
 #include "util.h"
9257a6
+#include "metawalk.h"
9257a6
 
9257a6
-extern int delete_metadata(struct gfs2_inode *ip, uint64_t block,
9257a6
-			   struct gfs2_buffer_head **bh, int h, int *is_valid,
9257a6
+extern int delete_metadata(struct iptr iptr, struct gfs2_buffer_head **bh, int h, int *is_valid,
9257a6
 			   int *was_duplicate, void *private);
9257a6
 extern int delete_leaf(struct gfs2_inode *ip, uint64_t block, void *private);
9257a6
 extern int delete_data(struct gfs2_inode *ip, uint64_t metablock,
9257a6
diff --git a/gfs2/fsck/fs_recovery.c b/gfs2/fsck/fs_recovery.c
9257a6
index 3acbb5d7..614c01ac 100644
9257a6
--- a/gfs2/fsck/fs_recovery.c
9257a6
+++ b/gfs2/fsck/fs_recovery.c
9257a6
@@ -636,11 +636,11 @@ static int rangecheck_jblock(struct gfs2_inode *ip, uint64_t block)
9257a6
 	return meta_is_good;
9257a6
 }
9257a6
 
9257a6
-static int rangecheck_jmeta(struct gfs2_inode *ip, uint64_t block,
9257a6
-			       struct gfs2_buffer_head **bh, int h,
9257a6
-			       int *is_valid, int *was_duplicate,
9257a6
-			       void *private)
9257a6
+static int rangecheck_jmeta(struct iptr iptr, struct gfs2_buffer_head **bh, int h,
9257a6
+                            int *is_valid, int *was_duplicate, void *private)
9257a6
 {
9257a6
+	struct gfs2_inode *ip = iptr.ipt_ip;
9257a6
+	uint64_t block = iptr_block(iptr);
9257a6
 	int rc;
9257a6
 
9257a6
 	*bh = NULL;
9257a6
diff --git a/gfs2/fsck/metawalk.c b/gfs2/fsck/metawalk.c
9257a6
index dbe9f1f6..d91ed63a 100644
9257a6
--- a/gfs2/fsck/metawalk.c
9257a6
+++ b/gfs2/fsck/metawalk.c
9257a6
@@ -1207,9 +1207,11 @@ static void file_ra(struct gfs2_inode *ip, struct gfs2_buffer_head *bh,
9257a6
 			      extlen * sdp->bsize, POSIX_FADV_WILLNEED);
9257a6
 }
9257a6
 
9257a6
-static int do_check_metalist(struct gfs2_inode *ip, uint64_t block, int height,
9257a6
-                             struct gfs2_buffer_head **bhp, struct metawalk_fxns *pass)
9257a6
+static int do_check_metalist(struct iptr iptr, int height, struct gfs2_buffer_head **bhp,
9257a6
+                             struct metawalk_fxns *pass)
9257a6
 {
9257a6
+	struct gfs2_inode *ip = iptr.ipt_ip;
9257a6
+	uint64_t block = iptr_block(iptr);
9257a6
 	int was_duplicate = 0;
9257a6
 	int is_valid = 1;
9257a6
 	int error;
9257a6
@@ -1217,7 +1219,7 @@ static int do_check_metalist(struct gfs2_inode *ip, uint64_t block, int height,
9257a6
 	if (pass->check_metalist == NULL)
9257a6
 		return 0;
9257a6
 
9257a6
-	error = pass->check_metalist(ip, block, bhp, height, &is_valid,
9257a6
+	error = pass->check_metalist(iptr, bhp, height, &is_valid,
9257a6
 				     &was_duplicate, pass->private);
9257a6
 	if (error == meta_error) {
9257a6
 		stack;
9257a6
@@ -1267,10 +1269,11 @@ static int build_and_check_metalist(struct gfs2_inode *ip, osi_list_t *mlp,
9257a6
 				    struct metawalk_fxns *pass)
9257a6
 {
9257a6
 	uint32_t height = ip->i_di.di_height;
9257a6
-	struct gfs2_buffer_head *bh, *nbh, *metabh = ip->i_bh;
9257a6
+	struct gfs2_buffer_head *metabh = ip->i_bh;
9257a6
 	osi_list_t *prev_list, *cur_list, *tmp;
9257a6
+	struct iptr iptr = { .ipt_ip = ip, 0};
9257a6
 	int h, head_size, iblk_type;
9257a6
-	uint64_t *ptr, block, *undoptr;
9257a6
+	uint64_t *undoptr;
9257a6
 	int maxptrs;
9257a6
 	int error;
9257a6
 
9257a6
@@ -1310,39 +1313,37 @@ static int build_and_check_metalist(struct gfs2_inode *ip, osi_list_t *mlp,
9257a6
 		prev_list = &mlp[h - 1];
9257a6
 		cur_list = &mlp[h];
9257a6
 
9257a6
-		for (tmp = prev_list->next; tmp != prev_list; tmp = tmp->next){
9257a6
-			bh = osi_list_entry(tmp, struct gfs2_buffer_head,
9257a6
-					    b_altlist);
9257a6
-			if (gfs2_check_meta(bh->b_data, iblk_type)) {
9257a6
+		for (tmp = prev_list->next; tmp != prev_list; tmp = tmp->next) {
9257a6
+			iptr.ipt_off = head_size;
9257a6
+			iptr.ipt_bh = osi_list_entry(tmp, struct gfs2_buffer_head, b_altlist);
9257a6
+
9257a6
+			if (gfs2_check_meta(iptr_buf(iptr), iblk_type)) {
9257a6
 				if (pass->invalid_meta_is_fatal)
9257a6
 					return meta_error;
9257a6
 
9257a6
 				continue;
9257a6
 			}
9257a6
-
9257a6
 			if (pass->readahead)
9257a6
-				file_ra(ip, bh, head_size, maxptrs, h);
9257a6
+				file_ra(ip, iptr.ipt_bh, head_size, maxptrs, h);
9257a6
+
9257a6
 			/* Now check the metadata itself */
9257a6
-			for (ptr = (uint64_t *)(bh->b_data + head_size);
9257a6
-			     (char *)ptr < (bh->b_data + ip->i_sbd->bsize);
9257a6
-			     ptr++) {
9257a6
+			for (; iptr.ipt_off < ip->i_sbd->bsize; iptr.ipt_off += sizeof(uint64_t)) {
9257a6
+				struct gfs2_buffer_head *nbh = NULL;
9257a6
+
9257a6
 				if (skip_this_pass || fsck_abort) {
9257a6
 					free_metalist(ip, mlp);
9257a6
 					return meta_is_good;
9257a6
 				}
9257a6
-				nbh = NULL;
9257a6
-
9257a6
-				if (!*ptr)
9257a6
+				if (!iptr_block(iptr))
9257a6
 					continue;
9257a6
 
9257a6
-				block = be64_to_cpu(*ptr);
9257a6
-				error = do_check_metalist(ip, block, h, &nbh, pass);
9257a6
+				error = do_check_metalist(iptr, h, &nbh, pass);
9257a6
 				if (error == meta_error || error == meta_skip_further)
9257a6
 					goto error_undo;
9257a6
 				if (error == meta_skip_one)
9257a6
 					continue;
9257a6
 				if (!nbh)
9257a6
-					nbh = bread(ip->i_sbd, block);
9257a6
+					nbh = bread(ip->i_sbd, iptr_block(iptr));
9257a6
 				osi_list_add_prev(&nbh->b_altlist, cur_list);
9257a6
 			} /* for all data on the indirect block */
9257a6
 		} /* for blocks at that height */
9257a6
@@ -1353,16 +1354,16 @@ error_undo: /* undo what we've done so far for this block */
9257a6
 	if (pass->undo_check_meta == NULL)
9257a6
 		return error;
9257a6
 
9257a6
-	log_info(_("Undoing the work we did before the error on block %llu "
9257a6
-		   "(0x%llx).\n"), (unsigned long long)bh->b_blocknr,
9257a6
-		 (unsigned long long)bh->b_blocknr);
9257a6
-	for (undoptr = (uint64_t *)(bh->b_data + head_size); undoptr < ptr &&
9257a6
-		     (char *)undoptr < (bh->b_data + ip->i_sbd->bsize);
9257a6
+	log_info(_("Undoing the work we did before the error on block %"PRIu64" (0x%"PRIx64").\n"),
9257a6
+	         iptr.ipt_bh->b_blocknr, iptr.ipt_bh->b_blocknr);
9257a6
+	for (undoptr = (uint64_t *)(iptr_buf(iptr) + head_size);
9257a6
+	     undoptr < iptr_ptr(iptr) && undoptr < iptr_endptr(iptr);
9257a6
 	     undoptr++) {
9257a6
-		if (!*undoptr)
9257a6
+		uint64_t block = be64_to_cpu(*undoptr);
9257a6
+
9257a6
+		if (block == 0)
9257a6
 			continue;
9257a6
 
9257a6
-		block = be64_to_cpu(*undoptr);
9257a6
 		pass->undo_check_meta(ip, block, h, pass->private);
9257a6
 	}
9257a6
 	return error;
9257a6
diff --git a/gfs2/fsck/metawalk.h b/gfs2/fsck/metawalk.h
9257a6
index b5a037a3..592479df 100644
9257a6
--- a/gfs2/fsck/metawalk.h
9257a6
+++ b/gfs2/fsck/metawalk.h
9257a6
@@ -42,6 +42,17 @@ enum meta_check_rc {
9257a6
 	meta_skip_one = 2,
9257a6
 };
9257a6
 
9257a6
+struct iptr {
9257a6
+	struct gfs2_inode *ipt_ip;
9257a6
+	struct gfs2_buffer_head *ipt_bh;
9257a6
+	unsigned ipt_off;
9257a6
+};
9257a6
+
9257a6
+#define iptr_ptr(i) ((uint64_t *)(i.ipt_bh->b_data + i.ipt_off))
9257a6
+#define iptr_block(i) be64_to_cpu(*iptr_ptr(i))
9257a6
+#define iptr_endptr(i) ((uint64_t *)(iptr.ipt_bh->b_data + i.ipt_ip->i_sbd->bsize))
9257a6
+#define iptr_buf(i) (i.ipt_bh->b_data)
9257a6
+
9257a6
 /* metawalk_fxns: function pointers to check various parts of the fs
9257a6
  *
9257a6
  * The functions should return -1 on fatal errors, 1 if the block
9257a6
@@ -66,7 +77,7 @@ struct metawalk_fxns {
9257a6
 	int (*check_leaf) (struct gfs2_inode *ip, uint64_t block,
9257a6
 			   void *private);
9257a6
 	/* parameters to the check_metalist sub-functions:
9257a6
-	   ip: incore inode pointer
9257a6
+	   iptr: reference to the inode and its indirect pointer that we're analyzing
9257a6
 	   block: block number of the metadata block to be checked
9257a6
 	   bh: buffer_head to be returned
9257a6
 	   h: height
9257a6
@@ -79,7 +90,7 @@ struct metawalk_fxns {
9257a6
 	   returns: 0 - everything is good, but there may be duplicates
9257a6
 	            1 - skip further processing
9257a6
 	*/
9257a6
-	int (*check_metalist) (struct gfs2_inode *ip, uint64_t block,
9257a6
+	int (*check_metalist) (struct iptr iptr,
9257a6
 			       struct gfs2_buffer_head **bh, int h,
9257a6
 			       int *is_valid, int *was_duplicate,
9257a6
 			       void *private);
9257a6
diff --git a/gfs2/fsck/pass1.c b/gfs2/fsck/pass1.c
9257a6
index f03078e9..66cf6dc6 100644
9257a6
--- a/gfs2/fsck/pass1.c
9257a6
+++ b/gfs2/fsck/pass1.c
9257a6
@@ -39,9 +39,8 @@ struct block_count {
9257a6
 };
9257a6
 
9257a6
 static int p1check_leaf(struct gfs2_inode *ip, uint64_t block, void *private);
9257a6
-static int pass1_check_metalist(struct gfs2_inode *ip, uint64_t block,
9257a6
-			  struct gfs2_buffer_head **bh, int h, int *is_valid,
9257a6
-			  int *was_duplicate, void *private);
9257a6
+static int pass1_check_metalist(struct iptr iptr, struct gfs2_buffer_head **bh, int h,
9257a6
+                                int *is_valid, int *was_duplicate, void *private);
9257a6
 static int undo_check_metalist(struct gfs2_inode *ip, uint64_t block,
9257a6
 			       int h, void *private);
9257a6
 static int pass1_check_data(struct gfs2_inode *ip, uint64_t metablock,
9257a6
@@ -69,10 +68,8 @@ static int check_extended_leaf_eattr(struct gfs2_inode *ip, int i,
9257a6
 				     void *private);
9257a6
 static int finish_eattr_indir(struct gfs2_inode *ip, int leaf_pointers,
9257a6
 			      int leaf_pointer_errors, void *private);
9257a6
-static int invalidate_metadata(struct gfs2_inode *ip, uint64_t block,
9257a6
-			       struct gfs2_buffer_head **bh, int h,
9257a6
-			       int *is_valid, int *was_duplicate,
9257a6
-			       void *private);
9257a6
+static int invalidate_metadata(struct iptr iptr, struct gfs2_buffer_head **bh, int h,
9257a6
+                               int *is_valid, int *was_duplicate, void *private);
9257a6
 static int invalidate_leaf(struct gfs2_inode *ip, uint64_t block,
9257a6
 			   void *private);
9257a6
 static int invalidate_data(struct gfs2_inode *ip, uint64_t metablock,
9257a6
@@ -223,12 +220,12 @@ struct metawalk_fxns invalidate_fxns = {
9257a6
  * marked "in use" by the bitmap.  You don't want root's indirect blocks
9257a6
  * deleted, do you? Or worse, reused for lost+found.
9257a6
  */
9257a6
-static int resuscitate_metalist(struct gfs2_inode *ip, uint64_t block,
9257a6
-				struct gfs2_buffer_head **bh, int h,
9257a6
-				int *is_valid, int *was_duplicate,
9257a6
-				void *private)
9257a6
+static int resuscitate_metalist(struct iptr iptr, struct gfs2_buffer_head **bh, int h,
9257a6
+                                int *is_valid, int *was_duplicate, void *private)
9257a6
 {
9257a6
 	struct block_count *bc = (struct block_count *)private;
9257a6
+	struct gfs2_inode *ip = iptr.ipt_ip;
9257a6
+	uint64_t block = iptr_block(iptr);
9257a6
 
9257a6
 	*is_valid = 1;
9257a6
 	*was_duplicate = 0;
9257a6
@@ -344,15 +341,16 @@ static int p1check_leaf(struct gfs2_inode *ip, uint64_t block, void *private)
9257a6
 	return 0;
9257a6
 }
9257a6
 
9257a6
-static int pass1_check_metalist(struct gfs2_inode *ip, uint64_t block,
9257a6
-			  struct gfs2_buffer_head **bh, int h, int *is_valid,
9257a6
-			  int *was_duplicate, void *private)
9257a6
+static int pass1_check_metalist(struct iptr iptr, struct gfs2_buffer_head **bh, int h,
9257a6
+                                int *is_valid, int *was_duplicate, void *private)
9257a6
 {
9257a6
-	int q;
9257a6
-	int iblk_type;
9257a6
-	struct gfs2_buffer_head *nbh;
9257a6
 	struct block_count *bc = (struct block_count *)private;
9257a6
+	struct gfs2_inode *ip = iptr.ipt_ip;
9257a6
+	uint64_t block = iptr_block(iptr);
9257a6
+	struct gfs2_buffer_head *nbh;
9257a6
 	const char *blktypedesc;
9257a6
+	int iblk_type;
9257a6
+	int q;
9257a6
 
9257a6
 	*bh = NULL;
9257a6
 
9257a6
@@ -1111,11 +1109,12 @@ static int mark_block_invalid(struct gfs2_inode *ip, uint64_t block,
9257a6
 	return meta_is_good;
9257a6
 }
9257a6
 
9257a6
-static int invalidate_metadata(struct gfs2_inode *ip, uint64_t block,
9257a6
-			       struct gfs2_buffer_head **bh, int h,
9257a6
-			       int *is_valid, int *was_duplicate,
9257a6
-			       void *private)
9257a6
+static int invalidate_metadata(struct iptr iptr, struct gfs2_buffer_head **bh, int h,
9257a6
+                               int *is_valid, int *was_duplicate, void *private)
9257a6
 {
9257a6
+	struct gfs2_inode *ip = iptr.ipt_ip;
9257a6
+	uint64_t block = iptr_block(iptr);
9257a6
+
9257a6
 	*is_valid = 1;
9257a6
 	*was_duplicate = 0;
9257a6
 	return mark_block_invalid(ip, block, ref_as_meta, _("metadata"),
9257a6
@@ -1214,11 +1213,12 @@ static int rangecheck_block(struct gfs2_inode *ip, uint64_t block,
9257a6
 	return meta_is_good;
9257a6
 }
9257a6
 
9257a6
-static int rangecheck_metadata(struct gfs2_inode *ip, uint64_t block,
9257a6
-			       struct gfs2_buffer_head **bh, int h,
9257a6
-			       int *is_valid, int *was_duplicate,
9257a6
-			       void *private)
9257a6
+static int rangecheck_metadata(struct iptr iptr, struct gfs2_buffer_head **bh, int h,
9257a6
+                               int *is_valid, int *was_duplicate, void *private)
9257a6
 {
9257a6
+	struct gfs2_inode *ip = iptr.ipt_ip;
9257a6
+	uint64_t block = iptr_block(iptr);
9257a6
+
9257a6
 	*is_valid = 1;
9257a6
 	*was_duplicate = 0;
9257a6
 	return rangecheck_block(ip, block, bh, btype_meta, private);
9257a6
@@ -1317,12 +1317,13 @@ static int set_ip_blockmap(struct gfs2_inode *ip)
9257a6
 	return 0;
9257a6
 }
9257a6
 
9257a6
-static int alloc_metalist(struct gfs2_inode *ip, uint64_t block,
9257a6
-			  struct gfs2_buffer_head **bh, int h, int *is_valid,
9257a6
-			  int *was_duplicate, void *private)
9257a6
+static int alloc_metalist(struct iptr iptr, struct gfs2_buffer_head **bh, int h,
9257a6
+                          int *is_valid, int *was_duplicate, void *private)
9257a6
 {
9257a6
-	int q;
9257a6
 	const char *desc = (const char *)private;
9257a6
+	struct gfs2_inode *ip = iptr.ipt_ip;
9257a6
+	uint64_t block = iptr_block(iptr);
9257a6
+	int q;
9257a6
 
9257a6
 	/* No need to range_check here--if it was added, it's in range. */
9257a6
 	/* We can't check the bitmap here because this function is called
9257a6
diff --git a/gfs2/fsck/pass1b.c b/gfs2/fsck/pass1b.c
9257a6
index 62686fee..350902b4 100644
9257a6
--- a/gfs2/fsck/pass1b.c
9257a6
+++ b/gfs2/fsck/pass1b.c
9257a6
@@ -69,9 +69,8 @@ static void log_inode_reference(struct duptree *dt, osi_list_t *tmp, int inval)
9257a6
 		  (unsigned long long)dt->block, reftypestring);
9257a6
 }
9257a6
 
9257a6
-static int findref_meta(struct gfs2_inode *ip, uint64_t block,
9257a6
-			struct gfs2_buffer_head **bh, int h,
9257a6
-			int *is_valid, int *was_duplicate, void *private)
9257a6
+static int findref_meta(struct iptr iptr, struct gfs2_buffer_head **bh, int h,
9257a6
+                        int *is_valid, int *was_duplicate, void *private)
9257a6
 {
9257a6
 	*is_valid = 1;
9257a6
 	*was_duplicate = 0;
9257a6
@@ -393,10 +392,12 @@ static void resolve_dup_references(struct gfs2_sbd *sdp, struct duptree *dt,
9257a6
 	return;
9257a6
 }
9257a6
 
9257a6
-static int clone_check_meta(struct gfs2_inode *ip, uint64_t block,
9257a6
-			    struct gfs2_buffer_head **bh, int h,
9257a6
-			    int *is_valid, int *was_duplicate, void *private)
9257a6
+static int clone_check_meta(struct iptr iptr, struct gfs2_buffer_head **bh, int h,
9257a6
+                            int *is_valid, int *was_duplicate, void *private)
9257a6
 {
9257a6
+	struct gfs2_inode *ip = iptr.ipt_ip;
9257a6
+	uint64_t block = iptr_block(iptr);
9257a6
+
9257a6
 	*was_duplicate = 0;
9257a6
 	*is_valid = 1;
9257a6
 	*bh = bread(ip->i_sbd, block);
9257a6
@@ -788,11 +789,12 @@ static int check_leaf_refs(struct gfs2_inode *ip, uint64_t block,
9257a6
 	return add_duplicate_ref(ip, block, ref_as_meta, 1, INODE_VALID);
9257a6
 }
9257a6
 
9257a6
-static int check_metalist_refs(struct gfs2_inode *ip, uint64_t block,
9257a6
-			       struct gfs2_buffer_head **bh, int h,
9257a6
-			       int *is_valid, int *was_duplicate,
9257a6
-			       void *private)
9257a6
+static int check_metalist_refs(struct iptr iptr, struct gfs2_buffer_head **bh, int h,
9257a6
+                               int *is_valid, int *was_duplicate, void *private)
9257a6
 {
9257a6
+	struct gfs2_inode *ip = iptr.ipt_ip;
9257a6
+	uint64_t block = iptr_block(iptr);
9257a6
+
9257a6
 	*was_duplicate = 0;
9257a6
 	*is_valid = 1;
9257a6
 	return add_duplicate_ref(ip, block, ref_as_meta, 1, INODE_VALID);
9257a6
diff --git a/gfs2/fsck/pass2.c b/gfs2/fsck/pass2.c
9257a6
index d10b9089..d80f3063 100644
9257a6
--- a/gfs2/fsck/pass2.c
9257a6
+++ b/gfs2/fsck/pass2.c
9257a6
@@ -1873,10 +1873,12 @@ struct metawalk_fxns pass2_fxns = {
9257a6
 	.repair_leaf = pass2_repair_leaf,
9257a6
 };
9257a6
 
9257a6
-static int check_metalist_qc(struct gfs2_inode *ip, uint64_t block,
9257a6
-			     struct gfs2_buffer_head **bh, int h,
9257a6
-			     int *is_valid, int *was_duplicate, void *private)
9257a6
+static int check_metalist_qc(struct iptr iptr, struct gfs2_buffer_head **bh, int h,
9257a6
+                             int *is_valid, int *was_duplicate, void *private)
9257a6
 {
9257a6
+	struct gfs2_inode *ip = iptr.ipt_ip;
9257a6
+	uint64_t block = iptr_block(iptr);
9257a6
+
9257a6
 	*was_duplicate = 0;
9257a6
 	*is_valid = 1;
9257a6
 	*bh = bread(ip->i_sbd, block);