This bug is missing log files that will aid in diagnosing the problem.
While running an Ubuntu kernel (not a mainline or third-party kernel)
please enter the following command in a terminal window:

apport-collect 1791323

and then change the status of the bug to 'Confirmed'.

If, due to the nature of the issue you have encountered, you are unable
to run this command, please add a comment stating that fact and change
the bug status to 'Confirmed'.

This change has been made by an automated script, maintained by the
Ubuntu Kernel Team.

** Changed in: linux (Ubuntu)
       Status: New => Incomplete

-- 
You received this bug notification because you are a member of Kernel
Packages, which is subscribed to linux in Ubuntu.
https://bugs.launchpad.net/bugs/1791323

Title:
  XFS fallocate implementation incorrectly reports ENOSPC

Status in linux package in Ubuntu:
  Incomplete

Bug description:
  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!

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1791323/+subscriptions

-- 
Mailing list: https://launchpad.net/~kernel-packages
Post to     : kernel-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kernel-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to