From 0647bf564f1e35975e84f152dcba1a1ad54fbe7e Mon Sep 17 00:00:00 2001 From: Wang Shilong Date: Wed, 20 Nov 2013 09:01:52 +0800 Subject: [PATCH] Btrfs: improve forever loop when doing balance relocation We hit a forever loop when doing balance relocation,the reason is that we firstly reserve 4M(node size is 16k).and within transaction we will try to add extra reservation for snapshot roots,this will return -EAGAIN if there has been a thread flushing space to reserve space.We will do this again and again with filesystem becoming nearly full. If the above '-EAGAIN' case happens, we try to refill reservation more outsize of transaction, and this will return eariler in enospc case,however, this dosen't really hurt because it makes no sense doing balance relocation with the filesystem nearly full. Miao Xie helped a lot to track this issue, thanks. Signed-off-by: Wang Shilong Signed-off-by: Miao Xie Signed-off-by: Josef Bacik Signed-off-by: Chris Mason --- Reading git-format-patch failed