fallocate with FALLOC_FL_ZERO_RANGE produces zero-size files on zfs in Jammy
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Native ZFS for Linux |
Fix Released
|
Unknown
|
|||
mysql-8.0 (Ubuntu) |
Invalid
|
Undecided
|
Unassigned | ||
zfs-linux (Ubuntu) |
Fix Released
|
High
|
Unassigned | ||
Jammy |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
[Summary]
When running Jammy on zfs or LXD with a zfs pool on a Jammy host, fallocate creates a zero-sized file.
The issue was originally found when installing mysql on LXD, where fallocate would create a zero-sized ib_logfile1 file. The original information in this bug is based on that.
[Steps to Reproduce]
touch foo.img
fallocate -z -l 10M foo.img
ls -la foo.img
On a non-zfs Jammy system this will show something like:
-rw-r--r-- 1 root root 10M ...
while on zfs it will show:
-rw-rw-r-- 1 root root 0 ...
[Original Description]
I came across this error when testing various mysql setups in an LXD container and managed to reproduce it consistently. I'm unable to reproduce on Ubuntu desktop or server though since the prerequisites are probably handled properly there.
ProblemType: Package
DistroRelease: Ubuntu 20.04
Package: mysql-server-8.0 8.0.28-
ProcVersionSign
Uname: Linux 5.15.0-25-generic x86_64
ApportVersion: 2.20.11-
Architecture: amd64
CasperMD5CheckR
Date: Fri Apr 15 21:31:09 2022
Dmesg:
ErrorMessage: installed mysql-server-8.0 package post-installation script subprocess returned error exit status 1
KernLog:
Logs.var.
MySQLConf.
MySQLConf.
[mysqldump]
quick
quote-names
max_allowed_packet = 16M
MySQLConf.
MySQLVarLibDirL
ProcCmdline: BOOT_IMAGE=
Python3Details: /usr/bin/python3.8, Python 3.8.10, python3-minimal, 3.8.2-0ubuntu2
PythonDetails: N/A
RelatedPackageV
dpkg 1.19.7ubuntu3
apt 2.0.6
SourcePackage: mysql-8.0
Title: package mysql-server-8.0 8.0.28-
UpgradeStatus: No upgrade log present (probably fresh install)
summary: |
- mysql-server install crashes after installing mysql-common and - libmysqlclient21 first + mysql-server install crashes in LXD container |
description: | updated |
summary: |
- mysql-server install crashes in LXD container + mysql-server install crashes in LXD container on Jammy host |
summary: |
- fallocate produces zero-size files on zfs in Jammy + fallocate with FALLOC_FL_ZERO_RANGE produces zero-size files on zfs in + Jammy |
description: | updated |
Changed in zfs: | |
status: | Unknown → New |
Changed in mysql-8.0 (Ubuntu): | |
status: | Triaged → Invalid |
Changed in zfs: | |
status: | New → Fix Released |
Changed in zfs-linux (Ubuntu): | |
status: | Triaged → In Progress |
tags: | added: verification-done-jammy |
Steps to reproduce:
# lxc launch images:ubuntu/focal test-mysql
# lxc exec test-mysql bash
# apt update && apt dist-upgrade -y
# apt install mysql-server