[LTP] [PATCH 2/2] fallocate05: Deallocate whole file on bcachefs

Li Wang liwang@redhat.com
Fri Sep 6 05:18:16 CEST 2024


On Thu, Sep 5, 2024 at 9:45 PM Martin Doucha <mdoucha@suse.cz> wrote:

> The default deallocation size is likely too small for bcachefs
> to actually release the blocks. Since it is also a copy-on-write
> filesystem, deallocated the whole file like on Btrfs.
>
> Signed-off-by: Martin Doucha <mdoucha@suse.cz>

---
>
> AFAICT Bcachefs uses 512 byte data blocks by default but 256KB inode
> blocks. The whole file will be 128KB and 32KB gets deallocated which may
> be too small. However, I'm not entirely sure whether this is the best
> solution.
>

I think this solution is correct.

Even deallocating a hole size (32KB) that is larger than a block size
512bytes,
but that does not mean the Bcachefs can satisfy enough size for following
written
behavior, because the allocation of new data blocks (hole) might involve
modifying
metadata structures that need more space(extends more inode blocks 256KB).

If the filesystem cannot accommodate these changes, it could lead to an
ENOSPC error.

Reviewed-by: Li Wang <liwang@redhat.com>


-- 
Regards,
Li Wang


More information about the ltp mailing list