-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Warn if volblocksize is smaller than ashift #10199
Conversation
Ah printf differences eh, interesting. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice to make the same check for recordsize
for filesystems.
lib/libzfs/libzfs_dataset.c
Outdated
(void) fprintf(stderr, dgettext(TEXT_DOMAIN, "Warning: " | ||
"volblocksize (%llu) < ashift (%llu / %llu)\n" | ||
"means all writes are amplified and space wasted.\n"), | ||
blocksize, ashift, 1ULL << ashift); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We've been explicitly adding a u_longlong_t
cast to resolve the compiler warnings for the %llu
types. Alternately, you could use zfs_nicebytes
to pretty-print some of values with human readable suffixes. Either solution seems fine to me.
Actual ashift on the one vdev here is 12. The "ashift" property itself means relatively little so that concerns me a bit. |
Such a setting results in write amplification and excessive space wastage. $ ./zfs create -s -V 3GB -b 2048 tank/vol Warning: volblocksize (2048) < ashift (12 / 4096) means all writes are amplified and space wasted. Signed-off-by: Jorgen Lundman <[email protected]>
754861c
to
a605fd8
Compare
I didn't realize that the |
Codecov Report
@@ Coverage Diff @@
## master #10199 +/- ##
==========================================
- Coverage 79.48% 79.21% -0.28%
==========================================
Files 387 387
Lines 123388 123392 +4
==========================================
- Hits 98079 97740 -339
- Misses 25309 25652 +343
Continue to review full report at Codecov.
|
|
@lundman I don't think so. We could expose that as a new (hidden?) pool property. Or in the zpool config, which is even more hidden, and in keeping with how we expose other pool "internals". But I'd prefer to move away from that since it's much more fragile and undocumented/undocumentable than properties. |
Users easily created ZVOL with a smaller volblocksize than ashift, then find it
writes much more than expected. I didn't want to stop them from being able to do that, but
at least warn the users of this consequence.
Motivation and Context
Related to https://github.com/openzfsonwindows/ZFSin/issues/239 and initial commit
openzfsonwindows/ZFSin@ee8e361
Description
Simple warning after saving the ashift value.
How Has This Been Tested?
Tested on Windows. But the better way to add new code is to have it approved here, then trickle down. Also gives us a chance to massage the message into English that is more clear.
Types of changes
Checklist:
Signed-off-by
.Such a setting results in write amplification and excessive space
wastage.
$ ./zfs create -s -V 3GB -b 2048 tank/vol
Warning: volblocksize (2048) < ashift (12 / 4096)
means all writes are amplified and space wasted.
Signed-off-by: Jorgen Lundman [email protected]