Le 21/06/2016 15:17, Graham Cobb a écrit : > On 21/06/16 12:51, Austin S. Hemmelgarn wrote: >> The scrub design works, but the whole state file thing has some rather >> irritating side effects and other implications, and developed out of >> requirements that aren't present for balance (it might be nice to check >> how many chunks actually got balanced after the fact, but it's not >> absolutely necessary). > Actually, that would be **really** useful. I have been experimenting > with cancelling balances after a certain time (as part of my > "balance-slowly" script). I have got it working, just using bash > scripting, but it means my script does not know whether any work has > actually been done by the balance run which was cancelled (if no work > was done, but it timed out anyway, there is probably no point trying > again with the same timeout later!).
I have the exact same use case. We trigger balances when we detect that the free space is mostly allocated but unused to prevent possible ENOSPC events. A balance on busy disks can slow other I/Os so we try to limit them in time (in our use case 15 to 30 min max is mostly OK). Trying to emulate this by using [d|v]range was a possibility too but I thought it could be hard to get right. We actually inspect the allocated space before and after to report the difference but we don't know if this difference is caused by the aborted balance or other activity (we have to read the kernel logs to find out). Lionel -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html