Public bug reported:
When given an offset of 0 and a length, fallocate (man 2 fallocate)
reports ENOSPC if the size of the file + the length to be allocated is
greater than the available space.
Example below using the fallocate command (man 1 fallocate) for
simplicity; the issue is with the logic backing the system call.
chathaway@bender:~/temp$ fallocate -l 1GB example.img
chathaway@bender:~/temp$ mkfs.xfs example.img
meta-data=example.img isize=512 agcount=4, agsize=61035 blks
= sectsz=512 attr=2, projid32bit=1
= crc=1 finobt=1, sparse=0, rmapbt=0,
reflink=0
data = bsize=4096 blocks=244140, imaxpct=25
= sunit=0 swidth=0 blks
naming =version 2 bsize=4096 ascii-ci=0 ftype=1
log =internal log bsize=4096 blocks=855, version=2
= sectsz=512 sunit=0 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0
chathaway@bender:~/temp$ sudo modprobe loop
chathaway@bender:~/temp$ mkdir mnt
chathaway@bender:~/temp$ sudo mount -o loop ./example.img ./mnt/
chathaway@bender:~/temp$ cd mnt
chathaway@bender:~/temp/mnt$ sudo fallocate -l 768MB -o 0 hello.txt
chathaway@bender:~/temp/mnt$ sudo fallocate -l 768MB -o 0 hello.txt
fallocate: fallocate failed: No space left on device
chathaway@bender:~/temp/mnt$ df -h .
Filesystem Size Used Avail Use% Mounted on
/dev/loop0 951M 766M 185M 81% /home/chathaway/temp/mnt
Expected behaviour: because we allocate 768MB starting at offset 0, and
have 951MB on the disk, we would expect that the allocation should be
fine. Other filesystem behave this way (for example, ext4).
Thanks!
** Affects: linux (Ubuntu)
Importance: Undecided
Status: New
** Tags: xfs
** Attachment added: "attachments.tar.gz"
https://bugs.launchpad.net/bugs/1791323/+attachment/5186057/+files/attachments.tar.gz
--
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1791323
Title:
XFS fallocate implementation incorrectly reports ENOSPC
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1791323/+subscriptions
--
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs