xfs
[Top] [All Lists]

Re: [PATCH 21/30] db: verify and calculate dquot CRCs

To: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Subject: Re: [PATCH 21/30] db: verify and calculate dquot CRCs
From: Dave Chinner <david@xxxxxxxxxxxxx>
Date: Tue, 5 Nov 2013 11:25:06 +1100
Cc: xfs@xxxxxxxxxxx
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <20131104090627.GB23564@xxxxxxxxxxxxx>
References: <1383107481-28937-1-git-send-email-david@xxxxxxxxxxxxx> <1383107481-28937-22-git-send-email-david@xxxxxxxxxxxxx> <20131104090627.GB23564@xxxxxxxxxxxxx>
User-agent: Mutt/1.5.21 (2010-09-15)
On Mon, Nov 04, 2013 at 01:06:27AM -0800, Christoph Hellwig wrote:
> On Wed, Oct 30, 2013 at 03:31:12PM +1100, Dave Chinner wrote:
> > 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 <dchinner@xxxxxxxxxx>
> > ---
> >  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);
> 
> The patch looks good to get going, but it seems we'd be better off going
> through an ops vector here in some form..

Potentially - if we need a third object-within-a-buffer verification
then it will be worthwhile to do this. However, for the moment we
only have to support inodes and dquots and so for the moment I don't
see that further abstraction is necessary.

Hence right now I'd prefer to make it explicit that we are doing
these CRC calculations here and just keep in mind that if we are
going to add more we need to abstract it into an ops vector at that
time...

Cheers,

Dave.
-- 
Dave Chinner
david@xxxxxxxxxxxxx

<Prev in Thread] Current Thread [Next in Thread>