xfs
[Top] [All Lists]

Re: [PATCH] xfs_db: properly set dquot_buf when operating on dquot

To: xfs@xxxxxxxxxxx
Subject: Re: [PATCH] xfs_db: properly set dquot_buf when operating on dquot
From: Eric Sandeen <sandeen@xxxxxxxxxxx>
Date: Tue, 13 Dec 2016 14:12:03 -0600
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <d2abfb81-38d2-3f00-fea9-8a405664dea1@xxxxxxxxxxx>
References: <d2abfb81-38d2-3f00-fea9-8a405664dea1@xxxxxxxxxxx>
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.5.1
On 8/26/16 2:03 PM, Eric Sandeen wrote:
> The earlier commit:
> 
> 66a40d02 db: verify and calculate dquot CRCs
> 
> added a "dquot_buf" to the iocur to specify when we were operating
> on a dquot and thus handle dquot CRC updates - but nothing ever
> actually set dquot_buf to a non-zero value.
> 
> Without doing so, we don't recalculate the dquot crc when
> changing contents of a dquot:
> 
> # xfs_db -x -c "dquot -u 500" -c "p crc" -c "write diskdq.bcount 2" \
>           -c "p crc" crctestfile
> crc = 0xfd293c68 (correct)
> diskdq.bcount = 2
> crc = 0xfd293c68 (correct)
> 
> [ the "(correct)" tag is another, different issue ]
> 
> # xfs_db -x -c "dquot -u 500" -c "p crc" crctestfile
> Metadata CRC error detected at xfs_dquot block 0xd8/0x1000
> crc = 0xfd293c68 (bad)
> 
> With this change, dquot CRCs are properly recalculated in write_cur.
> 
> Signed-off-by: Eric Sandeen <sandeen@xxxxxxxxxx>

Ping on this old patch?

Thanks,
-Eric

> ---
> 
> diff --git a/db/dquot.c b/db/dquot.c
> index 47740f0..061eca5 100644
> --- a/db/dquot.c
> +++ b/db/dquot.c
> @@ -164,6 +164,7 @@ dquot_f(
>       }
>       set_cur(&typtab[TYP_DQBLK], XFS_FSB_TO_DADDR(mp, bm.startblock), blkbb,
>               DB_RING_IGN, NULL);
> +     iocur_top->dquot_buf = 1;
>       off_cur(qoff * (int)sizeof(xfs_dqblk_t), sizeof(xfs_dqblk_t));
>       ring_add();
>       return 0;
> 
> _______________________________________________
> xfs mailing list
> xfs@xxxxxxxxxxx
> http://oss.sgi.com/mailman/listinfo/xfs
> 

<Prev in Thread] Current Thread [Next in Thread>
  • Re: [PATCH] xfs_db: properly set dquot_buf when operating on dquot, Eric Sandeen <=