xfs
[Top] [All Lists]

[PATCH 2/2] xfs: ensure we copy buffer type in da btree root splits

To: xfs@xxxxxxxxxxx
Subject: [PATCH 2/2] xfs: ensure we copy buffer type in da btree root splits
From: Dave Chinner <david@xxxxxxxxxxxxx>
Date: Mon, 2 Sep 2013 10:32:01 +1000
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <1378081921-18570-1-git-send-email-david@xxxxxxxxxxxxx>
References: <1378081921-18570-1-git-send-email-david@xxxxxxxxxxxxx>
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
aasociated 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.

Signed-off-by: Dave Chinner <dchinner@xxxxxxxxxx>
---
 fs/xfs/xfs_da_btree.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/xfs/xfs_da_btree.c b/fs/xfs/xfs_da_btree.c
index d4e59a4..069537c 100644
--- a/fs/xfs/xfs_da_btree.c
+++ b/fs/xfs/xfs_da_btree.c
@@ -635,6 +635,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;
 
-- 
1.8.3.2

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