cluster: STABLE2 - Write out changes when fixing EA corruption
Bob Peterson
rpeterso@fedoraproject.org
Wed Apr 29 21:31:00 GMT 2009
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=d533275202980637a257dd90c459433f04cdc97f
Commit: d533275202980637a257dd90c459433f04cdc97f
Parent: 5e46cc6aba469f3daf92c3e481ed4802868edf47
Author: Bob Peterson <rpeterso@redhat.com>
AuthorDate: Tue Apr 28 09:34:36 2009 -0500
Committer: Bob Peterson <rpeterso@redhat.com>
CommitterDate: Tue Apr 28 15:04:40 2009 -0500
Write out changes when fixing EA corruption
bz 495774
The previous patch for bz 495774 failed to actually
write the changes to disk. This patch adds that ability.
---
gfs/gfs_fsck/metawalk.c | 10 +++++-----
gfs/gfs_fsck/pass1.c | 6 ++++++
2 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/gfs/gfs_fsck/metawalk.c b/gfs/gfs_fsck/metawalk.c
index b1b1de9..64bd519 100644
--- a/gfs/gfs_fsck/metawalk.c
+++ b/gfs/gfs_fsck/metawalk.c
@@ -362,6 +362,7 @@ static int check_eattr_entries(struct fsck_inode *ip, osi_buf_t *bh,
/* Endianness doesn't matter
in this case because it's
a single byte. */
+ write_buf(sdp, bh, 0);
return -1;
}
log_err("The bad EA was not fixed.\n");
@@ -410,12 +411,11 @@ static int check_leaf_eattr(struct fsck_inode *ip, uint64_t block,
relse_buf(ip->i_sbd, bh);
return 1;
}
- }
-
- check_eattr_entries(ip, bh, pass);
+ check_eattr_entries(ip, bh, pass);
- if (bh)
- relse_buf(ip->i_sbd, bh);
+ if (bh)
+ relse_buf(ip->i_sbd, bh);
+ }
return 0;
}
diff --git a/gfs/gfs_fsck/pass1.c b/gfs/gfs_fsck/pass1.c
index d5578c9..3768ebf 100644
--- a/gfs/gfs_fsck/pass1.c
+++ b/gfs/gfs_fsck/pass1.c
@@ -246,6 +246,12 @@ static int clear_eas(struct fsck_inode *ip, struct block_count *bc,
return 0;
}
gfs_dinode_out(&ip->i_di, BH_DATA(dibh));
+ if (write_buf(sdp, dibh, 0) < 0) {
+ stack;
+ log_crit("Bad EA reference remains.\n");
+ } else {
+ log_warn("Bad EA reference cleared.\n");
+ }
relse_buf(sdp, dibh);
return 1;
} else {
More information about the Cluster-cvs
mailing list