public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Fix infinite loop in btrfs_extent_post_op
@ 2009-01-21 11:51 Yan Zheng
  0 siblings, 0 replies; only message in thread
From: Yan Zheng @ 2009-01-21 11:51 UTC (permalink / raw)
  To: linux-btrfs, Chris Mason

Hello,

btrfs_extent_post_op calls finish_current_insert and
del_pending_extents. They both may enter infinite loop.
finish_current_insert enters infinite loop if it only
finds some backrefs to update. The infinite loop in
del_pending_extents is due to a variable not properly
set. Thank you,

Signed-off-by: Yan Zheng <zheng.yan@oracle.com>

---
diff -urp 1/fs/btrfs/extent-tree.c 2/fs/btrfs/extent-tree.c
--- 1/fs/btrfs/extent-tree.c	2009-01-07 07:16:42.762364700 +0800
+++ 2/fs/btrfs/extent-tree.c	2009-01-20 13:36:07.000000000 +0800
@@ -2159,7 +2159,8 @@ again:
 		ret = find_first_extent_bit(&info->extent_ins, search, &start,
 					    &end, EXTENT_WRITEBACK);
 		if (ret) {
-			if (skipped && all && !num_inserts) {
+			if (skipped && all && !num_inserts &&
+			    list_empty(&update_list)) {
 				skipped = 0;
 				search = 0;
 				continue;
@@ -2547,6 +2548,7 @@ again:
 		if (ret) {
 			if (all && skipped && !nr) {
 				search = 0;
+				skipped = 0;
 				continue;
 			}
 			mutex_unlock(&info->extent_ins_mutex);



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-01-21 11:51 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-21 11:51 [PATCH] Fix infinite loop in btrfs_extent_post_op Yan Zheng

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