From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 34C297F62 for ; Tue, 29 Oct 2013 23:31:36 -0500 (CDT) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay1.corp.sgi.com (Postfix) with ESMTP id 20B8A8F8059 for ; Tue, 29 Oct 2013 21:31:36 -0700 (PDT) Received: from ipmail07.adl2.internode.on.net (ipmail07.adl2.internode.on.net [150.101.137.131]) by cuda.sgi.com with ESMTP id VWmsLm7xaXOJPq6r for ; Tue, 29 Oct 2013 21:31:34 -0700 (PDT) Received: from disappointment.disaster.area ([192.168.1.110] helo=disappointment) by dastard with esmtp (Exim 4.76) (envelope-from ) id 1VbNRF-0002yt-TL for xfs@oss.sgi.com; Wed, 30 Oct 2013 15:31:26 +1100 Received: from dave by disappointment with local (Exim 4.80) (envelope-from ) id 1VbNRF-0007f4-Sl for xfs@oss.sgi.com; Wed, 30 Oct 2013 15:31:25 +1100 From: Dave Chinner Subject: [PATCH 21/30] db: verify and calculate dquot CRCs Date: Wed, 30 Oct 2013 15:31:12 +1100 Message-Id: <1383107481-28937-22-git-send-email-david@fromorbit.com> In-Reply-To: <1383107481-28937-1-git-send-email-david@fromorbit.com> References: <1383107481-28937-1-git-send-email-david@fromorbit.com> List-Id: XFS Filesystem from SGI List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: xfs-bounces@oss.sgi.com Sender: xfs-bounces@oss.sgi.com To: xfs@oss.sgi.com When we set the current Io cursor to point at a dquot block, verify that the dquot CRC is intact. And prior to writing such an IO cursor, calculate the dquot CRC. Signed-off-by: Dave Chinner --- db/io.c | 5 ++++- db/io.h | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/db/io.c b/db/io.c index 8ddb5e5..7281148 100644 --- a/db/io.c +++ b/db/io.c @@ -464,7 +464,9 @@ write_cur(void) if (iocur_top->ino_buf) libxfs_dinode_calc_crc(mp, iocur_top->data); - + if (iocur_top->dquot_buf) + xfs_update_cksum(iocur_top->data, sizeof(struct xfs_dqblk), + XFS_DQUOT_CRC_OFF); if (iocur_top->bbmap) write_cur_bbs(); else @@ -538,6 +540,7 @@ set_cur( iocur_top->dirino = dirino; iocur_top->mode = mode; iocur_top->ino_buf = 0; + iocur_top->dquot_buf = 0; /* store location in ring */ if (ring_flag) diff --git a/db/io.h b/db/io.h index 1f8270d..4f24c83 100644 --- a/db/io.h +++ b/db/io.h @@ -40,6 +40,7 @@ typedef struct iocur { struct xfs_buf *bp; /* underlying buffer */ int ino_crc_ok:1; int ino_buf:1; + int dquot_buf:1; } iocur_t; #define DB_RING_ADD 1 /* add to ring on set_cur */ -- 1.8.4.rc3 _______________________________________________ xfs mailing list xfs@oss.sgi.com http://oss.sgi.com/mailman/listinfo/xfs