xfs
[Top] [All Lists]

Re: [PATCH 05/32] xfs: ensure we copy buffer type in da btree root split

To: Dave Chinner <david@xxxxxxxxxxxxx>
Subject: Re: [PATCH 05/32] xfs: ensure we copy buffer type in da btree root splits
From: Eric Sandeen <sandeen@xxxxxxxxxxx>
Date: Tue, 08 Oct 2013 18:06:55 -0500
Cc: xfs@xxxxxxxxxxx
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <1380510944-8571-6-git-send-email-david@xxxxxxxxxxxxx>
References: <1380510944-8571-1-git-send-email-david@xxxxxxxxxxxxx> <1380510944-8571-6-git-send-email-david@xxxxxxxxxxxxx>
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:17.0) Gecko/20130801 Thunderbird/17.0.8
On 9/29/13 10:15 PM, Dave Chinner wrote:
> From: Dave Chinner <dchinner@xxxxxxxxxx>
> 
> When splitting the root of the da btree, we shuffled data between
> buffers and the structures that track them. At one point, we copy
> data and state from one buffer to another, including the ops
> associated with the buffer. When we do this, we also need to copy
> the buffer type associated with the buf log item so that the buffer
> is logged correctly. If we don't do that, log recovery won't
> recognise it and hence it won't recalculate the CRC on the buffer
> after recovery. This leads to a directory block that can't be read
> after recovery has run.
> 
> Found by inspection after finding the same problem with remote
> symlink buffers.

Makes sense, matches kernel commit 0a4edc8f0b54cd5f613e7fda7dc8106cb9869bc9

Reviewed-by: Eric Sandeen <sandeen@xxxxxxxxxx>

> Signed-off-by: Dave Chinner <dchinner@xxxxxxxxxx>
> ---
>  libxfs/xfs_da_btree.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/libxfs/xfs_da_btree.c b/libxfs/xfs_da_btree.c
> index b7b6705..f106e06 100644
> --- a/libxfs/xfs_da_btree.c
> +++ b/libxfs/xfs_da_btree.c
> @@ -612,6 +612,7 @@ xfs_da3_root_split(
>       xfs_trans_log_buf(tp, bp, 0, size - 1);
>  
>       bp->b_ops = blk1->bp->b_ops;
> +     xfs_trans_buf_copy_type(bp, blk1->bp);
>       blk1->bp = bp;
>       blk1->blkno = blkno;
>  
> 

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