<div dir="ltr">Thanks. That seemed to fix that bug.<div><br></div><div>Now I'm getting a lot of this:</div><div><div>xfs_da_do_buf(2): XFS_CORRUPTION_ERROR</div><div><br></div><div>fatal error -- can't read block 8388608 for directory inode 8628218</div>
</div><div><br></div><div>Then xfs_repair exits.</div><div><br></div><div>What I've been doing is what I saw in the FAQ where I would use xfs_db and write core.mode 0 for these inodes. But there are just so many of them. And is that even the right thing to do?</div>
<div><br></div><div>Thanks</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Oct 4, 2013 at 2:43 PM, Dave Chinner <span dir="ltr"><<a href="mailto:david@fromorbit.com" target="_blank">david@fromorbit.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Fri, Oct 04, 2013 at 10:51:50AM -0700, Viet Nguyen wrote:<br>
> Hi,<br>
><br>
> I was wondering if you got a chance to look at this and if one's available,<br>
> where can I get a patch?<br>
<br>
</div>Can you try the patch below?<br>
<div class="im"><br>
Cheers,<br>
<br>
Dave.<br>
--<br>
Dave Chinner<br>
<a href="mailto:david@fromorbit.com">david@fromorbit.com</a><br>
<br>
</div>libxfs: validity check the directory block leaf entry count<br>
<br>
From: Dave Chinner <<a href="mailto:dchinner@redhat.com">dchinner@redhat.com</a>><br>
<br>
The directory block format verifier fails to check that the leaf<br>
entry count is in a valid range, and so if it is corrupted then it<br>
can lead to derefencing a pointer outside the block buffer. While we<br>
can't exactly validate the count without first walking the directory<br>
block, we can ensure the count lands in the valid area within the<br>
directory block and hence avoid out-of-block references.<br>
<br>
Signed-off-by: Dave Chinner <<a href="mailto:dchinner@redhat.com">dchinner@redhat.com</a>><br>
---<br>
libxfs/xfs_dir2_data.c | 13 +++++++++++++<br>
1 file changed, 13 insertions(+)<br>
<br>
diff --git a/libxfs/xfs_dir2_data.c b/libxfs/xfs_dir2_data.c<br>
index 189699f..1b5196b 100644<br>
--- a/libxfs/xfs_dir2_data.c<br>
+++ b/libxfs/xfs_dir2_data.c<br>
@@ -59,6 +59,18 @@ __xfs_dir3_data_check(<br>
btp = xfs_dir2_block_tail_p(mp, hdr);<br>
lep = xfs_dir2_block_leaf_p(btp);<br>
endp = (char *)lep;<br>
+<br>
+ /*<br>
+ * The number of leaf entries is limited by the size of the<br>
+ * block and the amount of space used by the data entries.<br>
+ * We don't know how much space is used by the data entries yet,<br>
+ * so just ensure that the count falls somewhere inside the<br>
+ * block right now.<br>
+ */<br>
+ XFS_WANT_CORRUPTED_RETURN(be32_to_cpu(btp->count) ><br>
+ ((char *)btp - (char *)p) /<br>
+ sizeof(struct xfs_dir2_leaf_entry));<br>
+<br>
break;<br>
case cpu_to_be32(XFS_DIR3_DATA_MAGIC):<br>
case cpu_to_be32(XFS_DIR2_DATA_MAGIC):<br>
</blockquote></div><br></div>