cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
From: Abhi Das <adas@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] gfs2-utils: more fsck.gfs2 i_goal fixes
Date: Wed,  1 Apr 2015 09:55:01 -0500	[thread overview]
Message-ID: <1427900102-58542-1-git-send-email-adas@redhat.com> (raw)

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



             reply	other threads:[~2015-04-01 14:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-01 14:55 Abhi Das [this message]
2015-04-01 14:55 ` [Cluster-devel] gfs2_utils: more gfs2_convert i_goal fixes Abhi Das

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1427900102-58542-1-git-send-email-adas@redhat.com \
    --to=adas@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).