fallocate: --insert-range does not work with --posix

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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: signature.asc
Description: signature


[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux