From: Petr Vorel <pvorel@suse.cz>
To: Martin Doucha <mdoucha@suse.cz>
Cc: linux-bcachefs@vger.kernel.org,
Kent Overstreet <kent.overstreet@linux.dev>,
ltp@lists.linux.it
Subject: Re: [LTP] [PATCH 2/2] fallocate05: Deallocate whole file on bcachefs
Date: Fri, 6 Sep 2024 10:02:00 +0200 [thread overview]
Message-ID: <20240906080200.GA985598@pevik> (raw)
In-Reply-To: <20240905134502.33759-2-mdoucha@suse.cz>
Hi Martin, all,
[ Cc Kent and Bcachefs ML ]
> 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.
Make sense.
Reviewed-by: Petr Vorel <pvorel@suse.cz>
Kind regards,
Petr
> 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.
> See also https://bugzilla.suse.com/show_bug.cgi?id=1230155
> testcases/kernel/syscalls/fallocate/fallocate05.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
> diff --git a/testcases/kernel/syscalls/fallocate/fallocate05.c b/testcases/kernel/syscalls/fallocate/fallocate05.c
> index 979c70d6e..732a2f15d 100644
> --- a/testcases/kernel/syscalls/fallocate/fallocate05.c
> +++ b/testcases/kernel/syscalls/fallocate/fallocate05.c
> @@ -114,7 +114,8 @@ static void run(void)
> tst_res(TPASS, "fallocate() on full FS");
> /* Btrfs deallocates only complete extents, not individual blocks */
> - if (!strcmp(tst_device->fs_type, "btrfs"))
> + if (!strcmp(tst_device->fs_type, "btrfs") ||
> + !strcmp(tst_device->fs_type, "bcachefs"))
> holesize = bufsize + extsize;
> else
> holesize = DEALLOCATE_BLOCKS * blocksize;
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2024-09-06 8:02 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-05 13:44 [LTP] [PATCH 1/2] fallocate05: Check that deallocated file range is marked as a hole Martin Doucha
2024-09-05 13:45 ` [LTP] [PATCH 2/2] fallocate05: Deallocate whole file on bcachefs Martin Doucha
2024-09-06 3:18 ` Li Wang
2024-09-06 8:02 ` Petr Vorel [this message]
2024-09-06 10:12 ` Kent Overstreet
2024-09-10 2:39 ` Li Wang
2024-09-06 1:53 ` [LTP] [PATCH 1/2] fallocate05: Check that deallocated file range is marked as a hole Li Wang
2024-09-06 8:17 ` Petr Vorel
2024-09-06 8:28 ` Martin Doucha
2024-09-06 8:36 ` Petr Vorel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240906080200.GA985598@pevik \
--to=pvorel@suse.cz \
--cc=kent.overstreet@linux.dev \
--cc=linux-bcachefs@vger.kernel.org \
--cc=ltp@lists.linux.it \
--cc=mdoucha@suse.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox