]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: improve forever loop when doing balance relocation
authorWang Shilong <wangsl.fnst@cn.fujitsu.com>
Wed, 20 Nov 2013 01:01:52 +0000 (09:01 +0800)
committerChris Mason <clm@fb.com>
Tue, 28 Jan 2014 21:19:43 +0000 (13:19 -0800)
commit10121a5ad9b6c27f548b99426764e22ba012f660
tree80faa249bbeb1f5482717e1d0938ec2c198d7160
parent01c616ae93ebbac3519d22b4aba21c52f879cbdd
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 <wangsl.fnst@cn.fujitsu.com>
Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
Signed-off-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: Chris Mason <clm@fb.com>
fs/btrfs/relocation.c