openzfs/zfs

zpool apparently quietly truncates pools over the zfs file system size limit

Open

#6,118 创建于 2017年5月10日

在 GitHub 查看
 (4 评论) (0 反应) (0 负责人)C (9,908 star) (1,703 fork)batch import
Bot: Not Stalegood first issue

描述

System information

Type Version/Name
Distribution Name Ubuntu
Distribution Version 16.10
Linux Kernel 4.8.0-51-generic
Architecture x86_64
ZFS Version 0.6.5.8-0ubuntu4.2
SPL Version 0.6.5.8-2

Describe the problem you're observing

With a large zpool:

chokfi% zpool list OMG
NAME   SIZE  ALLOC   FREE  EXPANDSZ   FRAG    CAP  DEDUP  HEALTH  ALTROOT
OMG   15.9E   120K  15.9E         -     0%     0%  1.00x  ONLINE  -

add another chunk of space to push it past the 16EB limit on zfs file systems:

chokfi% ls -lh OMG5
-rwxr-xr-x 1 mwm mwm 4.1E May 10 15:43 OMG5
chokfi% ls -lh /home/mwm/tmp/OMG5
-rwxr-xr-x 1 mwm mwm 4.1E May 10 15:43 /home/mwm/tmp/OMG5
chokfi% zpool add OMG /home/mwm/tmp/OMG5
chokfi% 

And the zpool is now reported as being < 4EB in size:

chokfi% zpool list OMG
NAME   SIZE  ALLOC   FREE  EXPANDSZ   FRAG    CAP  DEDUP  HEALTH  ALTROOT
OMG   3.84E   133K  3.84E         -     0%     0%  1.00x  ONLINE  -

Describe how to reproduce the problem

I believe the above does the job. The one trick is:

chokfi% dd if=/dev/zero of=OMG6 bs=1 count=1 seek=8EB
1+0 records in
1+0 records out
1 byte copied, 0.000221949 s, 4.5 kB/s
chokfi% 

Include any warning/errors/backtraces from the system logs

There are none. That's the bug. Either the pool really is truncated, in which case this is a major bug, or the pool size is being misreported, in which case it's a minor bug.

I'd expect at the very least a warning in either case, and preferably in the former a refusal to perform the operation.

贡献者指南