Project

General

Profile

Actions

Bug #430

open

zfs create -b and -o volblocksize produce inconsistent results

Added by Albert Lee about 13 years ago. Updated about 13 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:
External Bug:

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
Actions #1

Updated by Albert Lee about 13 years ago

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

Updated by Emmanuel Hocdet about 13 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

Actions #3

Updated by Ryan W about 13 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?

Actions #4

Updated by Ryan W about 13 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.

Actions #5

Updated by Emmanuel Hocdet about 13 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
Actions #6

Updated by Ryan W about 13 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.

Actions #7

Updated by Emmanuel Hocdet about 13 years ago

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

Actions #8

Updated by Richard Elling about 13 years ago

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

Actions

Also available in: Atom PDF