util-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Schauer Marin Rodrigues <josch@mister-muffin.de>
To: util-linux@vger.kernel.org
Subject: fallocate: --insert-range does not work with --posix
Date: Thu, 16 Jan 2025 13:58:34 +0100	[thread overview]
Message-ID: <173703231441.1463009.14898093986088300384@localhost> (raw)

[-- Attachment #1: Type: text/plain, Size: 1098 bytes --]

Hi,

Steps to reproduce:

    $ fallocate -l 1024 test.img
    $ fallocate --posix --insert-range --offset=0 --length=4096 test.img
    $ ls -l test.img
    -rw-r--r-- 1 root root 4096 Jan 12 16:57 test.img

The size of test.img should be 5120 bytes and not 4096. It works fine
without --posix.

This issue can also be expressed as another test:

--- a/tests/expected/misc/fallocate
+++ b/tests/expected/misc/fallocate
@@ -1 +1,2 @@
 384
+4480
--- a/tests/ts/misc/fallocate
+++ b/tests/ts/misc/fallocate
@@ -34,6 +34,9 @@ else
                && ts_skip "'${fs_type}' not supported"
 fi
 
+$TS_CMD_FALLOCATE -x -i -o 0 -l 4096 $IMAGE >> $TS_OUTPUT 2>> $TS_ERRLOG
+stat -c "%s" $IMAGE >> $TS_OUTPUT 2>> $TS_ERRLOG
+
 rm -f $IMAGE
 
 ts_finalize

I also wonder why the size of --insert-range has to be 4096. If I try
smaller sizes, it does not work on my machine even when not using
--posix. If this is by design, maybe it should be mentioned in the
man page?

I'm running Debian bookworm and reproduced this with util-linux from
git.

Thanks!

cheers, josch

[-- Attachment #2: signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

-----BEGIN PGP SIGNATURE-----

iQIzBAABCgAdFiEElFhU6KL81LF4wVq58sulx4+9g+EFAmeJAnUACgkQ8sulx4+9
g+F+HQ/9FAgAvXntXGig9S0A/ruhS8uSONYr5YBcsLEixVgkd6w0x9XOVbU9HkDL
mtvtF1hbKR0A7BoMrlNKbDDAIbcaxJePMhfPpVUuRF5YRA2WSm6hOc09fOMx1pvP
2gN8vuV2z26xlND1eyEXT+2gt49zGJZYucuGywiV3AK+wuAQ+XsUqWRxQ2d3JtIY
zvxylVhwhPgnfkWzNxGcThyadvY1G7SOUvwHqZTJWBgZpiDZN0L7AswH+VU6dXeL
wFTs7PRcJYIuosc6Vrdl5LcM26W2UNhg9Zw3nKWsTkB40IcRts8hwT4F5He4HHHo
pxlD/UK3Ad38L7uoX6opL5WPjq66KeRmA21doa5PkZAFqLkaIpfixMVifs8PfrXb
8oCOxpNEGPxKoLDzoulEwaDLGGAAChUqObVwG1+loz95At6lePGB6VQUsZBOtNmb
roRHrX3RRiMFuv0zsS2eiCj1AZPyLBYoialisnUUHwBYbubFgW4WbEVdZ819lE4W
7LCFBUFQ0zzCw32PoUC8QM7XcHz6jB1Hf4e0Vumjnu3JfJg9S14uQdu4aTNoz8xi
q+7N8F+k+9WFKADHeuY/A4/EGlq90Ad4KOYhvil7eRjnPe0bMgs096lnvUcxL9lN
vzCYCIFNeqZJY8ac3xfvOFeYBhzo9BJlh9wy70t35IzrECTcvak=
=zdOL
-----END PGP SIGNATURE-----

                 reply	other threads:[~2025-01-16 13:04 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=173703231441.1463009.14898093986088300384@localhost \
    --to=josch@mister-muffin.de \
    --cc=util-linux@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).