|
From: | Paul Eggert |
Subject: | Re: [Bug-tar] Detection of sparse files is broken on btrfs |
Date: | Mon, 8 Jan 2018 09:36:45 -0800 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 |
On 01/08/2018 08:54 AM, Joerg Schilling wrote:
The most important fact however is that allocating spade happens before you copy data into that space.
Certainly users need the ability to make sure there's enough room before starting to copy, and POSIX allows for that with posix_fallocate. However, I don't see any POSIX requirement that st_blocks has anything to do with that room. For example, POSIX doesn't specify the size of the units that st_blocks uses, and it even allows the unit size to vary depending on the file. One cannot really deduce much of anything from st_blocks, if the goal is portability to any POSIX implementation.
I can. Filesystem implementers are trying to shoehorn their modern designs into the POSIX st_blocks interface which is loosely-specified and was inspired by an antiquated design. At some point, it is reasonable for them to give up with the pretense and just put 0 in st_blocks, since whatever number is put in there is in some sense "wrong" anyway.I cannot see any reason why deduplication between different filesystems that share a common dataset should be alllowed to be visible at user level.
[Prev in Thread] | Current Thread | [Next in Thread] |