xfs
[Top] [All Lists]

[PATCH 6/6] xfs_repair: make directory freespace table CRC format aware.

To: xfs@xxxxxxxxxxx
Subject: [PATCH 6/6] xfs_repair: make directory freespace table CRC format aware.
From: Dave Chinner <david@xxxxxxxxxxxxx>
Date: Mon, 20 May 2013 16:53:03 +1000
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <1369032783-24973-1-git-send-email-david@xxxxxxxxxxxxx>
References: <1368789205-19969-1-git-send-email-david@xxxxxxxxxxxxx> <1369032783-24973-1-git-send-email-david@xxxxxxxxxxxxx>
From: Dave Chinner <dchinner@xxxxxxxxxx>

We fail to take into account the format of the directory block when
reading the best free space form a directory data block for free
space block verification. This causes occasionaly failures in
xfstests.

Signed-off-by: Dave Chinner <dchinner@xxxxxxxxxx>
---
 repair/phase6.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/repair/phase6.c b/repair/phase6.c
index 1fdd4c8..2905a1c 100644
--- a/repair/phase6.c
+++ b/repair/phase6.c
@@ -1395,6 +1395,7 @@ longform_dir2_entry_check_data(
        xfs_dir2_db_t           db;
        xfs_dir2_data_entry_t   *dep;
        xfs_dir2_data_unused_t  *dup;
+       struct xfs_dir2_data_free *bf;
        char                    *endptr;
        int                     error;
        xfs_fsblock_t           firstblock;
@@ -1808,7 +1809,10 @@ _("entry \"%s\" in dir inode %" PRIu64 " inconsistent 
with .. value (%" PRIu64 "
                libxfs_dir2_data_log_header(tp, bp);
        libxfs_bmap_finish(&tp, &flist, &committed);
        libxfs_trans_commit(tp, 0);
-       freetab->ents[db].v = be16_to_cpu(d->bestfree[0].length);
+
+       /* record the largest free space in the freetab for later checking */
+       bf = xfs_dir3_data_bestfree_p(d);
+       freetab->ents[db].v = be16_to_cpu(bf[0].length);
        freetab->ents[db].s = 0;
 }
 
-- 
1.7.10.4

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