cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
* [Cluster-devel] [PATCH] fsck.gfs2: Don't check lh_crc for older filesystems
@ 2018-03-05 16:45 Andrew Price
  2018-03-05 16:51 ` Bob Peterson
  0 siblings, 1 reply; 2+ messages in thread
From: Andrew Price @ 2018-03-05 16:45 UTC (permalink / raw)
  To: cluster-devel.redhat.com

This fixes the case where fsck.gfs2 is built against v2 log headers but
the filesystem pre-dates them and so lh_crc is 0.

Signed-off-by: Andrew Price <anprice@redhat.com>
---
 gfs2/libgfs2/recovery.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/gfs2/libgfs2/recovery.c b/gfs2/libgfs2/recovery.c
index 51d210e4..b813d698 100644
--- a/gfs2/libgfs2/recovery.c
+++ b/gfs2/libgfs2/recovery.c
@@ -76,7 +76,10 @@ int get_log_header(struct gfs2_inode *ip, unsigned int blk,
 #ifdef GFS2_HAS_LH_V2
 	lh_crc = lh.lh_crc;
 #endif
-	if (error || lh.lh_blkno != blk || lh.lh_hash != hash || lh_crc != crc)
+	if (error || lh.lh_blkno != blk || lh.lh_hash != hash)
+		return 1;
+	/* Don't check the crc if it's zero, as it is in pre-v2 log headers */
+	if (lh_crc != 0 && lh_crc != crc)
 		return 1;
 
 	*head = lh;
-- 
2.14.3



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

* [Cluster-devel] [PATCH] fsck.gfs2: Don't check lh_crc for older filesystems
  2018-03-05 16:45 [Cluster-devel] [PATCH] fsck.gfs2: Don't check lh_crc for older filesystems Andrew Price
@ 2018-03-05 16:51 ` Bob Peterson
  0 siblings, 0 replies; 2+ messages in thread
From: Bob Peterson @ 2018-03-05 16:51 UTC (permalink / raw)
  To: cluster-devel.redhat.com

----- Original Message -----
| This fixes the case where fsck.gfs2 is built against v2 log headers but
| the filesystem pre-dates them and so lh_crc is 0.
| 
| Signed-off-by: Andrew Price <anprice@redhat.com>
| ---

Hi,

Yes, that looks right. ACK.

Regards,

Bob Peterson
Red Hat File Systems



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

end of thread, other threads:[~2018-03-05 16:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-05 16:45 [Cluster-devel] [PATCH] fsck.gfs2: Don't check lh_crc for older filesystems Andrew Price
2018-03-05 16:51 ` Bob Peterson

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).