Skip to content
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

Change ZVOL to use _by_dnode() methods #240

Merged
merged 4 commits into from
May 13, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions ZFSin/zfs/lib/libzfs/libzfs_dataset.c
Original file line number Diff line number Diff line change
Expand Up @@ -3802,6 +3802,9 @@ zfs_create(libzfs_handle_t *hdl, const char *path, zfs_type_t type,
zpool_close(zpool_handle);
return (-1);
}

// Look up ashift for later, in case we need it.
uint64_t ashift = zpool_get_prop_int(zpool_handle, ZPOOL_PROP_ASHIFT, NULL);
zpool_close(zpool_handle);

if (type == ZFS_TYPE_VOLUME) {
Expand Down Expand Up @@ -3848,6 +3851,14 @@ zfs_create(libzfs_handle_t *hdl, const char *path, zfs_type_t type,
"size"));
return (zfs_error(hdl, EZFS_BADPROP, errbuf));
}

if ((ashift > 0ULL) &&
(blocksize < (1ULL << ashift))) {
(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);
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ahrens You might want to de-ESOL the text... :)

}

(void) parent_name(path, parent, sizeof (parent));
Expand Down