public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dave Jones <davej@redhat.com>
To: Dave Chinner <david@fromorbit.com>,
	Linux Kernel <linux-kernel@vger.kernel.org>,
	xfs@oss.sgi.com
Subject: Re: XFS assertion from truncate. (3.10-rc2)
Date: Wed, 22 May 2013 12:19:46 -0400	[thread overview]
Message-ID: <20130522161946.GA25906@redhat.com> (raw)
In-Reply-To: <20130522142252.GB1407@redhat.com>

On Wed, May 22, 2013 at 10:22:52AM -0400, Dave Jones wrote:
 > On Wed, May 22, 2013 at 03:51:47PM +1000, Dave Chinner wrote:
 > 
 >  > > Tomorrow I'll also try running some older kernels with the same
 >  > > options to see if it's something new, or an older bug. This is a
 >  > > new machine, so it may be something that's been around for a
 >  > > while, and for whatever reason, my other machines don't hit
 >  > > this.
 >  > 
 >  > Another thing that just occurred to me - what compiler are you
 >  > using?  We had a report last week on #xfs that xfsdump was failing
 >  > with bad checksums because of link time optimisation (LTO) in
 >  > gcc-4.8.0. When they turned that off, everything worked fine. So if
 >  > you are using 4.8.0, perhaps trying a different compiler might be a
 >  > good idea, too.
 > 
 > Yeah, this is 4.8.0. This box is running F19-beta. 
 > I managed to shoehorn the gcc-4.7 from f18 on there though.
 > Bug reproduced instantly, so I think we can rule out compiler.
 > 
 > I ran 3.9 with the same debug options. Seems stable.
 > I'll do a bisect.

good news.  It wasn't until I started bisecting I realised I was still
carrying this patch from you to fix slab corruption I was seeing.

It seems to be the culprit (or is masking another problem -- I had to apply
it at each step of the bisect to get past the slab corruption bug).

	Dave

--- /home/davej/src/kernel/git-trees/linux/fs/xfs/xfs_extfree_item.c	2013-05-03 10:03:05.331370231 -0400
+++ linux-dj/fs/xfs/xfs_extfree_item.c	2013-05-07 20:46:42.389262296 -0400
@@ -305,10 +305,22 @@ xfs_efi_release(xfs_efi_log_item_t	*efip
 {
 	ASSERT(atomic_read(&efip->efi_next_extent) >= nextents);
 	if (atomic_sub_and_test(nextents, &efip->efi_next_extent)) {
+		int recovered;
+
+		/*
+		 * __xfs_efi_release() can release the last reference to the EFI
+		 * and free it, so it is unsafe to reference it after we've
+		 * released the reference. The only case this is safe to do is
+		 * if we are in recovery and the XFS_EFI_RECOVERED bit is set,
+		 * meaning that we have two references to release. Check the
+		 * recovered bit before the initial release, as we cannot
+		 * reliably check it afterwards.
+		 */
+		recovered = test_bit(XFS_EFI_RECOVERED, &efip->efi_flags);
 		__xfs_efi_release(efip);
 
 		/* recovery needs us to drop the EFI reference, too */
-		if (test_bit(XFS_EFI_RECOVERED, &efip->efi_flags))
+		if (recovered)
 			__xfs_efi_release(efip);
 	}
 }

  reply	other threads:[~2013-05-22 16:19 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-21 22:52 XFS assertion from truncate. (3.10-rc2) Dave Jones
2013-05-21 23:34 ` Dave Chinner
2013-05-21 23:40   ` Dave Jones
2013-05-21 23:54     ` Dave Chinner
2013-05-22  0:08       ` Dave Jones
2013-05-22  0:16         ` Dave Chinner
2013-05-22  2:56           ` Dave Jones
2013-05-22  4:03             ` Dave Chinner
2013-05-22  4:15               ` Dave Jones
2013-05-22  5:12                 ` Dave Chinner
2013-05-22  5:29                   ` Dave Jones
2013-05-22  5:51                     ` Dave Chinner
2013-05-22 14:22                       ` Dave Jones
2013-05-22 16:19                         ` Dave Jones [this message]
2013-05-22 22:09                           ` Dave Chinner
2013-05-22 23:53                             ` Dave Jones
2013-05-23 15:17                             ` Dave Jones
2013-05-23 18:13                               ` Dave Jones
2013-05-22 21:54                       ` Dave Chinner
2013-05-23 18:49                         ` Dave Jones
2013-05-23 22:30                           ` Dave Chinner
2013-05-24  0:49                             ` Dave Jones
2013-05-24  1:26                               ` Dave Chinner
2013-05-24  1:36                                 ` Dave Jones
2013-05-24  1:52                                 ` Dave Jones
2013-05-24  3:03                                   ` Dave Jones
2013-05-24  8:03                                     ` Dave Chinner
2013-05-24 20:16                                       ` Dave Jones
2013-05-25  4:58                                       ` Eric Sandeen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130522161946.GA25906@redhat.com \
    --to=davej@redhat.com \
    --cc=david@fromorbit.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=xfs@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox