Skip to contentSkip to conversation

Replace log checksumming code with CRCs.

PATCH In review Christoph Hellwig 2 participants 2 messages Sep 25, 2008 – Dec 3, 2008 XFS filesystem

lore
Share & tools
lore
#0 lore raw

PATCH 9/9 Replace log checksumming code with CRCs.

From: Dave Chinner <[email protected]>

The log has debug only checksum validation; replace this with stronger CRCs and always use it.

So far we only checksum the payload in every log buffer. For the final version this needs to be extended to include the headers, too.

[hch: minor adaptions]

fs/xfs/xfs_log_priv.h +2 -2
Index: linux-2.6-xfs/fs/xfs/xfs_log_priv.h
===================================================================
@@ -142,7 +142,7 @@ static inline uint xlog_get_client_id(__
 /*
  * Flags for log structure
  */
-#define XLOG_CHKSUM_MISMATCH	0x1	/* used only during recovery */
+#define XLOG_CRC_MISMATCH	0x1	/* used only during recovery */
 #define XLOG_ACTIVE_RECOVERY	0x2	/* in the middle of recovery */
 #define	XLOG_RECOVERY_NEEDED	0x4	/* log was recovered */
 #define XLOG_IO_ERROR		0x8	/* log hit an I/O error, and being
@@ -293,7 +293,7 @@ typedef struct xlog_rec_header {
 	__be32	  h_len;	/* len in bytes; should be 64-bit aligned: 4 */
 	__be64	  h_lsn;	/* lsn of this LR			:  8 */
 	__be64	  h_tail_lsn;	/* lsn of 1st LR w/ buffers not committed: 8 */
-	__be32	  h_chksum;	/* may not be used; non-zero if used	:  4 */
+	__be32	  h_crc;	/* crc of log record			:  4 */
 	__be32	  h_prev_block; /* block number to previous LR		:  4 */
 	__be32	  h_num_logops;	/* number of log operations in this LR	:  4 */
 	__be32	  h_cycle_data[XLOG_HEADER_CYCLE_SIZE / BBSIZE];
fs/xfs/xfs_log_recover.c +95 -81

281 lines not on this page · raw message

#1 lore raw

On Fri, Sep 26, 2008 at 12:56:50AM +0200, Christoph Hellwig wrote:

| From: Dave Chinner <[email protected]>
| 
| The log has debug only checksum validation; replace this with
| stronger CRCs and always use it.
| 
| So far we only checksum the payload in every log buffer.  For the final
| version this needs to be extended to include the headers, too.
| 
| 
| [hch: minor adaptions]

looks good.

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs