On Tue, Oct 15, 2013 at 05:43:46PM -0400, Jeff Mahoney wrote:
On 10/15/13 7:55 AM, David Sterba wrote:
>> linux-1a7f:~ # btrfs filesystem df /mnt
>> System: total=4.00MiB, used=4.00KiB
>> Data+Metadata: total=5.00MiB, used=60.00KiB
I can rename
the files with 3.12-rc5, and I believe this is due to patch
"Btrfs: fix worst case calculator for space usage" that should be safe
to take to opensuse 13.1, but not at this time of release period.
I still can't rename a file using -rc5, but I have some data as to why.
So with ~ 4MB reserved, we end up returning ENOSPC for
reservation for the mv vs the ~300k required for the touch.
This explains why it worked for me, there was more than 4MB of free
space. The actual fs size was 9MB so we have 4MB for system and 5MB for
data+metadata, with some kilobytes consumed.
4 MB does seem a little high here, since that's
about 60% of the size
of the file system, but the reservation is rounded up to 4MB chunks. I've
looked up the commit that added that, and it's been there since global
reservations were introduced, so I'm not sure what the logic is there.
Probably just to ballpark it.
The reservations still shoot too high: the calculations are done for a
full tree height, ie. 8, but this does not make sense for a filesystem
that's 10MB in size.
We already limit the size of the reservation to 512MB,
so it might make
sense to limit it further to something like 25% of the file system.
There is always a test that can break the limit, even 512 MB is not
enough when there are many cpus and lots of unwritten data that rely on
the global reserve. Josef sent a patch to lift it to 1G (but the test
was still able to hit the limit). Also the percentage guesses work
sensibly only for some range of fs size.
I'm not sure we can't find a simple formula that would work for any
filesystem size, so we can try to make separate logic based entierly on
fs size. But this should rather be discussed upstream.
To unsubscribe, e-mail: opensuse-kernel+unsubscribe(a)opensuse.org
To contact the owner, e-mail: opensuse-kernel+owner(a)opensuse.org