Btrfs: Make defrag check nodes against the progress key to prevent repeating work

Signed-off-by: Chris Mason <chris.mason@oracle.com>
diff --git a/fs/btrfs/tree-defrag.c b/fs/btrfs/tree-defrag.c
index 65ef123..6ef1ba5f 100644
--- a/fs/btrfs/tree-defrag.c
+++ b/fs/btrfs/tree-defrag.c
@@ -227,7 +227,8 @@
 			break;
 		if (wret < 0)
 			ret = wret;
-		ret = -EAGAIN;
+		else
+			ret = -EAGAIN;
 		break;
 	}
 	for (i = 0; i <= orig_level; i++) {