<div dir="ltr"><div><div>Hi Brain,<br></div>Can I change as following?<br>--- a/xfs_inode.c<br>+++ b/xfs_inode.c<br>@@ -1773,6 +1773,8 @@ xfs_iunlink_remove(<br>                        if (last_ibp != NULL) {<br>                                xfs_trans_brelse(tp, last_ibp);<br>
                        }<br>+                        ASSERT(next_agino != NULLAGINO);<br>+                        ASSERT(next_agino != 0);<br>                        next_ino = XFS_AGINO_TO_INO(mp, agno, next_agino);<br>
                        error = xfs_inotobp(mp, tp, next_ino, &last_dip,<br>                                            &last_ibp, &last_offset, 0);<br>@@ -1783,8 +1785,6 @@ xfs_iunlink_remove(<br>                                return error;<br>
                        }<br>                        next_agino = be32_to_cpu(last_dip->di_next_unlinked);<br>-                       ASSERT(next_agino != NULLAGINO);<br>-                       ASSERT(next_agino != 0);<br>
                }<br>                /*<br>                 * Now last_ibp points to the buffer previous to us on<br><br></div>Thank you.<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/4/17 ·ûÓÀÌΠ<span dir="ltr"><<a href="mailto:yongtaofu@gmail.com" target="_blank">yongtaofu@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div>Hi Brain,<br></div>If it is because NULLAGINO is passed in  to xfs_inotobp().<br></div>Can I move the following two lines before xfs_inotobp?<br>
<br>For example:<br><br>1767                 while (next_agino != agino) {<br>
1768                         /*<br>1769                          * If the last inode wasn't the one pointing to<br>1770                          * us, then release its buffer since we're not<br>1771                          * going to do anything with it.<br>

1772                          */<br>1773                         if (last_ibp != NULL) {<br>1774                                 xfs_trans_brelse(tp, last_ibp);<br>1775                         }<br>1776                         next_ino = XFS_AGINO_TO_INO(mp, agno, next_agino);<br>

+                               ASSERT(next_agino != NULLAGINO);<br>+                               ASSERT(next_agino != 0);<br>1777                         error = xfs_inotobp(mp, tp, next_ino, &last_dip,<br>1778                                             &last_ibp, &last_offset, 0);<br>

1779                         if (error) {<br>1780                                 xfs_warn(mp,<br>1781                                         "%s: xfs_inotobp() returned error %d.",<br>1782                                         __func__, error);<br>

1783                                 return error;<br>1784                         }<br>1785                         next_agino = be32_to_cpu(last_dip->di_next_unlinked);<br>-                               //ASSERT(next_agino != NULLAGINO);<br>

-                               //ASSERT(next_agino != 0);<br>1788                 }<br></div>I don't understand xfs well and correct me if I'm totally wrong.<br><div><div><div>Thank you very much.<br></div></div>

</div></div><div class="gmail_extra"><div><div class="h5"><br><br><div class="gmail_quote">2013/4/17 ·ûÓÀÌΠ<span dir="ltr"><<a href="mailto:yongtaofu@gmail.com" target="_blank">yongtaofu@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div dir="ltr">Hi Brain,<div>I want to ask a question, according to the shutdown trace. The ino in<font face="arial, sans-serif"><span style="font-size:14px"> </span></font><span style="font-family:arial,sans-serif;font-size:14px"> </span><span style="font-family:arial,sans-serif;font-size:14px">xfs_iunlink_remove is </span><span style="font-family:arial,sans-serif;font-size:14px">0x113, why </span><span style="font-family:arial,sans-serif;font-size:14px">xfs_imap got </span><span style="font-family:arial,sans-serif;font-size:14px">ino=0xffffffff</span><span style="font-family:arial,sans-serif;font-size:14px"> ? </span></div>


<div><span style="font-family:arial,sans-serif;font-size:14px"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:14px">--- xfs_imap -- module("xfs").function("xfs_</span><span style="font-family:arial,sans-serif;font-size:14px">imap@fs/xfs/xfs_ialloc.c:1257"</span><span style="font-family:arial,sans-serif;font-size:14px">).return -- return=0x16</span><br style="font-family:arial,sans-serif;font-size:14px">


<span style="font-family:arial,sans-serif;font-size:14px">vars: mp=0xffff882017a50800 tp=0xffff881c81797c70 ino=0xffffffff</span><span style="font-family:arial,sans-serif;font-size:14px"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:14px"><br>


</span></div><div><span style="font-family:arial,sans-serif;font-size:14px">--- xfs_iunlink_remove -- module("xfs").function("xfs_</span><span style="font-family:arial,sans-serif;font-size:14px">iunlink_remove@fs/xfs/xfs_</span><span style="font-family:arial,sans-serif;font-size:14px">inode.c:1680").return -- return=0x16</span><br style="font-family:arial,sans-serif;font-size:14px">


<span style="font-family:arial,sans-serif;font-size:14px">vars: tp=0xffff881c81797c70 ip=0xffff881003c13c00 next_ino=? mp=? agi=? dip=? agibp=0xffff880109b47e20 ibp=? agno=? agino=? next_agino=? last_ibp=? last_dip=0xffff882000000000 bucket_index=? offset=? last_offset=0xffffffffffff8810 error=? __func__=[...]</span><br style="font-family:arial,sans-serif;font-size:14px">


<span style="font-family:arial,sans-serif;font-size:14px">ip: i_ino = 0x113, i_flags = 0x0</span><span style="font-family:arial,sans-serif;font-size:14px"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:14px"><br>


</span></div><div><span style="font-family:arial,sans-serif;font-size:14px">Thank you.</span></div><div><span style="font-family:arial,sans-serif;font-size:14px"><br></span></div></div><div class="gmail_extra"><div><div>


<br><br><div class="gmail_quote">2013/4/17 ·ûÓÀÌΠ<span dir="ltr"><<a href="mailto:yongtaofu@gmail.com" target="_blank">yongtaofu@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


<div dir="ltr"><div><div>Hi Brain,<br></div>Thank you for your update, and I have applied your last kernel patch. However it is not easy to reproduce especially in out test environment. Till now is not happens again. I'll update the kernel patch now. BTW is there any findings in the logs of previous thread?<br>



<a href="http://oss.sgi.com/archives/xfs/2013-04/msg00327.html" target="_blank">http://oss.sgi.com/archives/xfs/2013-04/msg00327.html</a><br>I guess it tend to happen during glusterfs rebalance because glusterfs moves a lot of file from one server to another and then unlink it.<br>



<br></div>Thank you.<br></div><div class="gmail_extra"><div><div><br><br><div class="gmail_quote">2013/4/17 Brian Foster <span dir="ltr"><<a href="mailto:bfoster@redhat.com" target="_blank">bfoster@redhat.com</a>></span><br>


<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>On 04/16/2013 12:24 PM, Dave Chinner wrote:<br>
> On Mon, Apr 15, 2013 at 07:14:39PM -0400, Brian Foster wrote:<br>
>> Hi,<br>
>><br>
>> Thanks for the data in the previous thread:<br>
>><br>
>> <a href="http://oss.sgi.com/archives/xfs/2013-04/msg00327.html" target="_blank">http://oss.sgi.com/archives/xfs/2013-04/msg00327.html</a><br>
>><br>
</div>...<br>
<div>>><br>
>>      echo 1 > /sys/kernel/debug/tracing/events/xfs/xfs_iunlink/enable<br>
>>      echo 1 > /sys/kernel/debug/tracing/events/xfs/xfs_iunlink_remove/enable<br>
>>      ... reproduce ...<br>
>>      cat /sys/kernel/debug/tracing/trace > trace.output<br>
><br>
> It's better to use trace-cmd for this. it will result in less<br>
> dropped events. i.e.:<br>
><br>
>       $ trace-cmd record -e xfs_iunlink\*<br>
>       ... reproduce ...<br>
>       ^C<br>
>       $ trace-cmd report > trace.output<br>
><br>
>> --- a/fs/xfs/linux-2.6/xfs_trace.h<br>
>> +++ b/fs/xfs/linux-2.6/xfs_trace.h<br>
>> @@ -581,6 +581,8 @@ DEFINE_INODE_EVENT(xfs_file_fsync);<br>
</div>...<br>
<div>><br>
> I would suggest that the the tracing shoul dbe at entry of the<br>
> function, otherwise we won't get a tracepoint for the operation that<br>
> triggers the shutdown. (That's the reason most tracepoints in XFS<br>
> are at function entry...)<br>
><br>
<br>
</div>Good points, thanks Dave. A v2 that pulls up the tracepoints towards<br>
function entry is appended.<br>
<br>
Brian<br>
<br>
>From 280943e78ebe0b97a774cba51e7815c42f044b55 Mon Sep 17 00:00:00 2001<br>
From: Brian Foster <<a href="mailto:bfoster@redhat.com" target="_blank">bfoster@redhat.com</a>><br>
Date: Mon, 15 Apr 2013 18:16:24 -0400<br>
Subject: [PATCH v2] xfs: add tracepoints for xfs_iunlink and<br>
xfs_iunlink_remove<br>
<div><br>
---<br>
 fs/xfs/linux-2.6/xfs_trace.h |    2 ++<br>
 fs/xfs/xfs_inode.c           |    4 ++++<br>
 2 files changed, 6 insertions(+), 0 deletions(-)<br>
<br>
diff --git a/fs/xfs/linux-2.6/xfs_trace.h b/fs/xfs/linux-2.6/xfs_trace.h<br>
</div>index adc6ec4..338a0f9 100644<br>
--- a/fs/xfs/linux-2.6/xfs_trace.h<br>
+++ b/fs/xfs/linux-2.6/xfs_trace.h<br>
@@ -583,6 +583,8 @@ DEFINE_INODE_EVENT(xfs_file_fsync);<br>
 DEFINE_INODE_EVENT(xfs_destroy_inode);<br>
 DEFINE_INODE_EVENT(xfs_dirty_inode);<br>
<div> DEFINE_INODE_EVENT(xfs_clear_inode);<br>
+DEFINE_INODE_EVENT(xfs_iunlink);<br>
+DEFINE_INODE_EVENT(xfs_iunlink_remove);<br>
<br>
 DEFINE_INODE_EVENT(xfs_dquot_dqalloc);<br>
 DEFINE_INODE_EVENT(xfs_dquot_dqdetach);<br>
diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c<br>
</div>index 19900f0..d705c77 100644<br>
--- a/fs/xfs/xfs_inode.c<br>
+++ b/fs/xfs/xfs_inode.c<br>
@@ -1615,6 +1615,8 @@ xfs_iunlink(<br>
<br>
        mp = tp->t_mountp;<br>
<br>
+       trace_xfs_iunlink(ip);<br>
+<br>
        /*<br>
         * Get the agi buffer first.  It ensures lock ordering<br>
         * on the list.<br>
@@ -1694,6 +1696,8 @@ xfs_iunlink_remove(<br>
        mp = tp->t_mountp;<br>
        agno = XFS_INO_TO_AGNO(mp, ip->i_ino);<br>
<br>
+       trace_xfs_iunlink_remove(ip);<br>
+<br>
        /*<br>
         * Get the agi buffer first.  It ensures lock ordering<br>
         * on the list.<br>
<span><font color="#888888">--<br>
1.7.7.6<br>
<br>
</font></span></blockquote></div><br><br clear="all"><br></div></div><span><font color="#888888">-- <br>·ûÓÀÌÎ
</font></span></div>
</blockquote></div><br><br clear="all"><div><br></div></div></div><span><font color="#888888">-- <br>·ûÓÀÌÎ
</font></span></div>
</blockquote></div><br><br clear="all"><br></div></div><span class="HOEnZb"><font color="#888888">-- <br>·ûÓÀÌÎ
</font></span></div>
</blockquote></div><br><br clear="all"><br>-- <br>·ûÓÀÌÎ
</div>