public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] stable: restart busy extent search after node removal
@ 2011-07-12 22:03 Eric Sandeen
  2011-07-13  0:12 ` Dave Chinner
  2011-07-13 13:50 ` Alex Elder
  0 siblings, 2 replies; 8+ messages in thread
From: Eric Sandeen @ 2011-07-12 22:03 UTC (permalink / raw)
  To: xfs-oss

Sending this for review prior to stable submission...

A user on #xfs reported that a log replay was oopsing in
__rb_rotate_left() with a null pointer deref.

I traced this down to the fact that in xfs_alloc_busy_insert(),
we erased a node with rb_erase() when the new node overlapped,
but left it specified as the parent node for the new insertion.

So when we try to insert a new node with an erased node as
its parent, obviously things go very wrong.

Upstream,
97d3ac75e5e0ebf7ca38ae74cebd201c09b97ab2 xfs: exact busy extent tracking
actually fixed this, but as part of a much larger change.  Here's
the relevant bit:

                * We also need to restart the busy extent search from the
                * tree root, because erasing the node can rearrange the
                * tree topology.
                */
               rb_erase(&busyp->rb_node, &pag->pagb_tree);
               busyp->length = 0;
               return false;

We can do essentially the same thing to older codebases by restarting
the search after the erase.

This should apply to .35 through .39, and was tested on .39
with the oopsing replay reproducer.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---

Index: linux-2.6/fs/xfs/xfs_alloc.c
===================================================================
--- linux-2.6.orig/fs/xfs/xfs_alloc.c
+++ linux-2.6/fs/xfs/xfs_alloc.c
@@ -2664,6 +2664,12 @@ restart:
 					new->bno + new->length) -
 				min(busyp->bno, new->bno);
 		new->bno = min(busyp->bno, new->bno);
+		/*
+		 * Start the search over from the tree root, because
+		 * erasing the node can rearrange the tree topology.
+		 */
+		spin_unlock(&pag->pagb_lock);
+		goto restart;
 	} else
 		busyp = NULL;
 

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2011-07-16  1:20 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-12 22:03 [PATCH] stable: restart busy extent search after node removal Eric Sandeen
2011-07-13  0:12 ` Dave Chinner
2011-07-13  0:14   ` Eric Sandeen
2011-07-13  0:20     ` Dave Chinner
2011-07-13  1:27       ` Eric Sandeen
2011-07-15 14:19         ` Alex Elder
2011-07-16  1:20           ` Dave Chinner
2011-07-13 13:50 ` Alex Elder

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox