Project

General

Profile

Bug #430

zfs create -b and -o volblocksize produce inconsistent results

Added by Albert Lee over 9 years ago. Updated over 9 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
cmd - userland programs
Start date:
2010-11-27
Due date:
% Done:

0%

Estimated time:
Difficulty:
Tags:
Gerrit CR:

Description

libzfs fails to look for a string value for ZFS_PROP_VOLBLOCKSIZE in several places, so only -b should work correctly. However, -b creates volumes with the wrong size while -o volblocksize volumes have the right size.

From IRC:

zfs create -b 512 -o dedup=off -o compression=off -o logbias=latency -o sync=standard -o copies=1 -V 50GB tank/test512minusb
zfs create -V 50GB -o dedup=off -o compression=off -o logbias=latency -o sync=standard -o copies=1 -o volblocksize=512 tank/test512volblocksize

tank/test512minusb         75.2G   831G  23.9K  -
tank/test512volblocksize         51.6G   808G  23.9K  -


Related issues

Has duplicate illumos gate - Bug #437: zfs create -o volblocksize doesn't refreserve enoughNew2010-12-04

Actions

History

#1

Updated by Albert Lee over 9 years ago

  • Subject changed from zfs create -o volblocksize is broken to zfs create -b and -o volblocksize produce inconsistent results
#2

Updated by Emmanuel Hocdet over 9 years ago

Volume refreservation would be size+size/volblocksize*checksum size(256)
it's ok for -b
but with -o volblocksize the size for cheksums are always compute as if volblocksize=8k

#3

Updated by Ryan W over 9 years ago

Emmanuel Hocdet wrote:

Volume refreservation would be size+size/volblocksize*checksum size(256)
it's ok for -b
but with -o volblocksize the size for cheksums are always compute as if volblocksize=8k

But for a 50GB ZVOL you end up with 100/131072 = .000762 .. so is that 76GB? Why would a 50GB ZVOL need to be 50% larger than the provisioned size? All checksumming?

In otherwords, you are saying -b acts appropriately but -o volblocksize is the one that's actually broken?

#4

Updated by Ryan W over 9 years ago

This math also doesn't work right for other block sizes unless I'm doing it wrong.

50GB zvol

That's 100GB for the equation:

107 374 182 400/8192*256 or (2097152) = 51200 (or roughly 50GB) (this one is about spot on)

107 374 182 400/64K*256 or (65536*256=16777216) = 64000 (or roughly 62.5GB?)

But a 50GB volume with 64K blocksize comes out to 50.2GB not 62.5GB

Unless I'm doing something wrong.

#5

Updated by Emmanuel Hocdet over 9 years ago

50/512*(512+256) = 75

50/8192*(8192+256) = ~51.6

if you try 64k
50/65536*(65536+256) = ~50.2

-o volblocksize  look very strange
#6

Updated by Ryan W over 9 years ago

Emmanuel Hocdet wrote:

50/512*(512+256) = 75

50/8192*(8192+256) = ~51.6

if you try 64k
50/65536*(65536+256) = ~50.2

-o volblocksize look very strange

That seems like an entirely different calculation.

Before you said size+size/blocksize*checksum

Now you are using size/block size*(blocksize+checksum)

No wonder my calculations were broken.

#7

Updated by Emmanuel Hocdet over 9 years ago

yep different formula same result
50+50/65536*256 = ~50.2

#8

Updated by Richard Elling over 9 years ago

-b is correct, -o volblocksize is incorrect. See bug #437

Also available in: Atom PDF