cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
* [Cluster-devel] gfs2-utils: more fsck.gfs2 i_goal fixes
@ 2015-04-01 14:55 Abhi Das
  2015-04-01 14:55 ` [Cluster-devel] gfs2_utils: more gfs2_convert " Abhi Das
  0 siblings, 1 reply; 2+ messages in thread
From: Abhi Das @ 2015-04-01 14:55 UTC (permalink / raw)
  To: cluster-devel.redhat.com

fsck.gfs2 doesn't traverse the metadata tree for dirs in pass1 to
be able to get at the last allocated block for it and attempts to
set it to the inode block itself when it finds the i_goal value to
be outside of the current rgrp. This is not desirable and fsck.gfs2
should probably leave directories alone.

This patch simply skips over directories whose goal blocks fall
within the boundaries of the fs, assuming they are valid.

Resolves: rhbz#1186515
Signed-off-by: Abhi Das <adas@redhat.com>
---
 gfs2/fsck/metawalk.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/gfs2/fsck/metawalk.c b/gfs2/fsck/metawalk.c
index 6daaf9f..f05fb51 100644
--- a/gfs2/fsck/metawalk.c
+++ b/gfs2/fsck/metawalk.c
@@ -1995,6 +1995,14 @@ int check_i_goal(struct gfs2_inode *ip, uint64_t goal_blk,
 	if (sdp->gfs1 || ip->i_di.di_flags & GFS2_DIF_SYSTEM ||
 		ip->i_di.di_goal_meta == i_block)
 		return 0;
+	/* Don't fix directory goal blocks unless we know they're wrong.
+	 * i.e. out of bounds of the fs. Directories can easily have blocks
+	 * outside of the dinode's rgrp and thus we have no way of knowing
+	 * if the goal block is bogus or not. */
+	if (is_dir(&ip->i_di, ip->i_sbd->gfs1) &&
+	    (ip->i_di.di_goal_meta > sdp->sb_addr &&
+	     ip->i_di.di_goal_meta <= sdp->fssize))
+		return 0;
 	/* We default to the inode block */
 	if (!goal_blk)
 		goal_blk = i_block;
-- 
1.8.1.4



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-04-01 14:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-01 14:55 [Cluster-devel] gfs2-utils: more fsck.gfs2 i_goal fixes Abhi Das
2015-04-01 14:55 ` [Cluster-devel] gfs2_utils: more gfs2_convert " Abhi Das

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).