Re: [PATCH 2/5] xfs_db: check should deal with cow staging events correctly

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jan 03, 2018 at 10:40:19AM -0800, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@xxxxxxxxxx>
> Subject: [PATCH 2/5] xfs_db: check should deal with cow staging events correctly

s/events/extents/

> Teach xfs_check to record cow staging events correctly.  This means that

s/events/extents/

> we strip off the high bit before using startblock.

high, indeed. :P

--D

> 
> Signed-off-by: Darrick J. Wong <darrick.wong@xxxxxxxxxx>
> ---
>  db/check.c |   19 +++++++++++++++----
>  1 file changed, 15 insertions(+), 4 deletions(-)
> 
> 
> diff --git a/db/check.c b/db/check.c
> index 3afde02..2f8dee5 100644
> --- a/db/check.c
> +++ b/db/check.c
> @@ -4730,13 +4730,24 @@ scanfunc_refcnt(
>  		lastblock = 0;
>  		for (i = 0; i < be16_to_cpu(block->bb_numrecs); i++) {
>  			if (be32_to_cpu(rp[i].rc_refcount) == 1) {
> -				dbprintf(_(
> -		"leftover CoW extent (%u/%u) len %u\n"),
> +				xfs_agblock_t	agbno;
> +				char		*msg;
> +
> +				agbno = be32_to_cpu(rp[i].rc_startblock);
> +				if (agbno >= XFS_REFC_COW_START) {
> +					agbno -= XFS_REFC_COW_START;
> +					msg = _(
> +		"leftover CoW extent (%u/%u) len %u\n");
> +				} else {
> +					msg = _(
> +		"leftover CoW extent at unexpected address (%u/%u) len %u\n");
> +				}
> +				dbprintf(msg,
>  					seqno,
> -					be32_to_cpu(rp[i].rc_startblock),
> +					agbno,
>  					be32_to_cpu(rp[i].rc_blockcount));
>  				set_dbmap(seqno,
> -					be32_to_cpu(rp[i].rc_startblock),
> +					agbno,
>  					be32_to_cpu(rp[i].rc_blockcount),
>  					DBM_COWDATA, seqno, bno);
>  			} else {
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux