<br><br><div class="gmail_quote">On Thu, Sep 20, 2012 at 11:00 PM, Eric Sandeen <span dir="ltr">&lt;<a href="mailto:sandeen@sandeen.net" target="_blank">sandeen@sandeen.net</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5">On 9/20/12 7:40 PM, Anand Tiwari wrote:<br>
&gt; Hi All,<br>
&gt;<br>
&gt; I have been looking into an issue with xfs_repair with realtime sub volume. some times while running xfs_repair I see following errors<br>
&gt;<br>
&gt; ----------------------------<br>
&gt; data fork in rt inode 134 claims used rt block 19607<br>
&gt; bad data fork in inode 134<br>
&gt; would have cleared inode 134<br>
&gt; data fork in rt inode 135 claims used rt block 29607<br>
&gt; bad data fork in inode 135<br>
&gt; would have cleared inode 135<br>
&gt;         - agno = 1<br>
&gt;         - agno = 2<br>
&gt;         - agno = 3<br>
&gt;         - process newly discovered inodes...<br>
&gt; Phase 4 - check for duplicate blocks...<br>
&gt;         - setting up duplicate extent list...<br>
&gt;         - check for inodes claiming duplicate blocks...<br>
&gt;         - agno = 0<br>
&gt;         - agno = 1<br>
&gt;         - agno = 2<br>
&gt;         - agno = 3<br>
&gt; entry &quot;test-011&quot; in shortform directory 128 references free inode 134<br>
&gt; would have junked entry &quot;test-011&quot; in directory inode 128<br>
&gt; entry &quot;test-0&quot; in shortform directory 128 references free inode 135<br>
&gt; would have junked entry &quot;test-0&quot; in directory inode 128<br>
&gt; data fork in rt ino 134 claims dup rt extent,off - 0, start - 7942144, count 2097000<br>
&gt; bad data fork in inode 134<br>
&gt; would have cleared inode 134<br>
&gt; data fork in rt ino 135 claims dup rt extent,off - 0, start - 13062144, count 2097000<br>
&gt; bad data fork in inode 135<br>
&gt; would have cleared inode 135<br>
&gt; No modify flag set, skipping phase 5<br>
&gt; ------------------------<br>
&gt;<br>
&gt; Here is the bmap for both inodes.<br>
&gt;<br>
&gt; xfs_db&gt; inode 135<br>
&gt; xfs_db&gt; bmap<br>
&gt; data offset 0 startblock 13062144 (12/479232) count 2097000 flag 0<br>
&gt; data offset 2097000 startblock 15159144 (14/479080) count 2097000 flag 0<br>
&gt; data offset 4194000 startblock 17256144 (16/478928) count 2097000 flag 0<br>
&gt; data offset 6291000 startblock 19353144 (18/478776) count 2097000 flag 0<br>
&gt; data offset 8388000 startblock 21450144 (20/478624) count 2097000 flag 0<br>
&gt; data offset 10485000 startblock 23547144 (22/478472) count 2097000 flag 0<br>
&gt; data offset 12582000 startblock 25644144 (24/478320) count 2097000 flag 0<br>
&gt; data offset 14679000 startblock 27741144 (26/478168) count 2097000 flag 0<br>
&gt; data offset 16776000 startblock 29838144 (28/478016) count 2097000 flag 0<br>
&gt; data offset 18873000 startblock 31935144 (30/477864) count 1607000 flag 0<br>
&gt; xfs_db&gt; inode 134<br>
&gt; xfs_db&gt; bmap<br>
&gt; data offset 0 startblock 7942144 (7/602112) count 2097000 flag 0<br>
&gt; data offset 2097000 startblock 10039144 (9/601960) count 2097000 flag 0<br>
&gt; data offset 4194000 startblock 12136144 (11/601808) count 926000 flag 0<br>
<br>
</div></div>It&#39;s been a while since I thought about realtime, but -<br>
<br>
That all seems fine, I don&#39;t see anything overlapping there, they are<br>
all perfectly adjacent, though of interesting size.<br>
<div class="im"><br>
&gt;<br>
&gt; by looking into xfs_repair code, it looks like repair does not handle<br>
&gt; a case where we have more than one extent in a real-time extent.<br>
&gt; following is code from repair/dinode.c: process_rt_rec<br>
<br>
</div>&quot;more than one extent in a real-time extent?&quot;  I&#39;m not sure what that means.<br>
<br>
Every extent above is length 2097000 blocks, and they are adjacent.<br>
But you say your realtime extent size is 512 blocks ... which doesn&#39;t go<br>
into 2097000 evenly.   So that&#39;s odd, at least.<br>
<br></blockquote><div><br>well, lets look at first extent<br>&gt; data offset 0 startblock 13062144 (12/479232) count 2097000 flag 0<br>
&gt; data offset 2097000 startblock 15159144 (14/479080) count 2097000 flag 0<br>startblock is aligned and rtext is 25512,  since the blockcount is not multiple of 512, last realtime extent ( 25512 + 4095) is partially used, 360 blks<br>
second extent start from realtime extent 29607 (ie 25512 + 4095).  so, yes, extents are not overlapping, but 29607 realtime extent is shared by two extents.<br>Now once xfs_repair detects this case in phase 2, it bails out and clears that inode. I think  search for duplicate extent is done in phase 4, but inode is marked already. <br>
<br><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Can you provide your xfs_info output for this fs?<br>
Or maybe better yet an xfs_metadump image.<br>
<div class="im"><br></div></blockquote><div><br>I will do it soon.  The other  thing I noticed is if I try to delete this file (inode 135),  I get following assertion failure. <br><br>[75669.291000] Assertion failed: prev.br_state == XFS_EXT_NORM, file: fs/xfs/xfs_bmap.c, line: 5187                                                                             <br>
[75669.300000] [&lt;8024dc44&gt;] assfail+0x28/0x2c                                                                                                                                   <br>[75669.300000] [&lt;801d8864&gt;] xfs_bunmapi+0x1288/0x14e4                                                                                                                           <br>
[75669.300000] [&lt;8020aff4&gt;] xfs_itruncate_finish+0x344/0x738                                                                                                                    <br>[75669.300000] [&lt;802363b0&gt;] xfs_inactive+0x4a8/0x51c                                                                                                                            <br>
[75669.300000] [&lt;80109124&gt;] evict+0x28/0xd0                                                                                                                                     <br>[75669.300000] [&lt;80109c14&gt;] iput+0x19c/0x2d8                                                                                                                                    <br>
[75669.300000] [&lt;800fe58c&gt;] do_unlinkat+0x10c/0x19c                                                                                                                             <br>[75669.300000] [&lt;80011b7c&gt;] stack_done+0x20/0x40                     <br>
<br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
&gt; -----<br>
&gt;      for (b = irec-&gt;br_startblock; b &lt; irec-&gt;br_startblock +<br>
&gt;                         irec-&gt;br_blockcount; b += mp-&gt;m_sb.sb_rextsize)  {<br>
&gt;                 ext = (xfs_drtbno_t) b / mp-&gt;m_sb.sb_rextsize;<br>
&gt;                 pwe = xfs_sb_version_hasextflgbit(&amp;mp-&gt;m_sb) &amp;&amp;<br>
&gt;                                 irec-&gt;br_state == XFS_EXT_UNWRITTEN &amp;&amp;<br>
&gt;                                 (b % mp-&gt;m_sb.sb_rextsize != 0);<br>
&gt; -----<br>
&gt;<br>
&gt; In my case rextsize is 512 (512 * 4096 = 2mb). So we have multiple<br>
&gt; extents (written extents to be precise, thanks dchinner for that),<br>
&gt; value of &quot;ext&quot; will be same for all of them and xfs_repair does not<br>
&gt; like it. thus the error message &quot;&quot;data fork in rt inode XX claims<br>
&gt; used rt block XX&quot;.<br>
<br>
</div>&quot;ext&quot; should not be the same for all of them; ext is the realtime extent<br>
number in the fs, based on the physical start, br_startblock,<br>
divided by the rt extent size.  There shouldn&#39;t be duplicate values<br>
of &quot;ext&quot; based on the bmaps above.<br>
<br>
The error comes from search_rt_dup_extent() which looks for overlaps<br>
elsewhere in the fs...<br>
<br>
If you can provide a metadump of the fs it might be easier to see what&#39;s going on.<br>
<br>
-Eric<br>
<div class="im"><br>
&gt; If I ignore this failure condition, xfs_repairs seems to be happy.<br>
&gt; (FYI: this file-system is cleanly umounted) But in my opinion, its<br>
&gt; not good as these multiple extents can overlap too.<br>
<br>
&gt; Should we be using XR_E_MULT to flag and keep track of duplicated<br>
&gt; real-time extents. (maybe use the present API for adding/detecting<br>
&gt; duplicate extents)<br>
&gt;<br>
&gt; I am open of suggestion or comments on how to fix this.<br>
&gt;<br>
&gt; xfs_repair version is 3.1.8 and kernel 2.6.37.<br>
&gt;<br>
&gt; thanks,<br>
&gt; Anand<br>
&gt;<br>
&gt;<br>
&gt;<br>
</div>&gt; _______________________________________________<br>
&gt; xfs mailing list<br>
&gt; <a href="mailto:xfs@oss.sgi.com">xfs@oss.sgi.com</a><br>
&gt; <a href="http://oss.sgi.com/mailman/listinfo/xfs" target="_blank">http://oss.sgi.com/mailman/listinfo/xfs</a><br>
&gt;<br>
<br>
</blockquote></div><br>