zfs set volsize fail
Type: Defect
On Rocky Linux, volume expansion fails, and the XFS file system gets unmounted and can't be mounted.
`
OS: Rocky Linux 9.7
kernel: 5.14.0-611.5.1.el9_7.x86_64
zfs: 2.2.10-1
zfs-kmod: 2.2.10-1
OpenEBS ZFS LocalPV version: v2.1.6
Client Version: v1.24.10
Kustomize Version: v4.5.4
Server Version: v1.24.10
`
My steps:
```
set -euo pipefail
ID="repro_zvol_xfs_$(date %Y%m%d%H%M%S)_$$"
VOL="datapool/${ID}"
MNT="/mnt/${ID}"
# 1. Create a temporary 1G zvol
zfs create -s -V 1G -o volmode=dev "${VOL}"
DEV="/dev/zvol/${VOL}"
# 2. Wait for the device node to appear
for i in $(seq 1 30); do
[ -e "${DEV}" ] && break
udevadm settle || true
sleep 1
done
REAL_DEV="$(readlink -f "${DEV}")"
echo "VOL=${VOL}"
echo "DEV=${DEV}"
echo "REAL_DEV=${REAL_DEV}"
echo "MNT=${MNT}"
# 3. Format with XFS and mount
mkfs.xfs -f "${DEV}"
mkdir -p "${MNT}"
mount "${DEV}" "${MNT}"
# 4. Check before expansion
df -hT "${MNT}"
blockdev --getsize64 "${REAL_DEV}"
# 5. Only expand zvol, don't run xfs_growfs
zfs set volsize=2G "${VOL}"
udevadm settle || true
sleep 3
# 6. Check the block device and mount point status
blockdev --getsize64 "${REAL_DEV}"
stat "${MNT}" || true
df -hT "${MNT}" || true
# 7. Run xfs_growfs, observe failure
xfs_growfs "${MNT}" || true
# 8. Check kernel logs
journalctl -k --since "5 minutes ago" --no-pager | egrep 'XFS|zd|Block device removal|Input/output|Buffer I/O|writeback' || true
```
Failure phenomenon:
```
The zvol capacity has changed.
blockdev shows it changed from 1073741824 to 2147483648
Mount point I/O is abnormal.
stat/df on the mount point returns Input/output error
xfs_growfs failed.
xfs_growfs: /mnt/... is not a mounted XFS filesystem
Kernel log:
XFS (zdN): Block device removal (0x20) detected ... Shutting down filesystem.
XFS (zdN): Please unmount the filesystem and fix the problem(s)
```
> I can reproduce this without zfs I doesn't happen after zfs/kernel update, so I'm going to close this.
0 条评论