Skip to content

Commit c5f001a

Browse files
committed
Refine special_small_blocks property validation
Signed-off-by: Don Brady <[email protected]>
1 parent 5a83f76 commit c5f001a

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lib/libzfs/libzfs_dataset.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1034,6 +1034,7 @@ zfs_valid_proplist(libzfs_handle_t *hdl, zfs_type_t type, nvlist_t *nvl,
10341034
nvlist_t *ret;
10351035
int chosen_normal = -1;
10361036
int chosen_utf = -1;
1037+
int set_maxbs = 0;
10371038

10381039
if (nvlist_alloc(&ret, NV_UNIQUE_NAME, 0) != 0) {
10391040
(void) no_memory(hdl);
@@ -1252,12 +1253,17 @@ zfs_valid_proplist(libzfs_handle_t *hdl, zfs_type_t type, nvlist_t *nvl,
12521253
(void) zfs_error(hdl, EZFS_BADPROP, errbuf);
12531254
goto error;
12541255
}
1256+
/* save the ZFS_PROP_RECORDSIZE during create op */
1257+
if (zpool_hdl == NULL && prop == ZFS_PROP_RECORDSIZE) {
1258+
set_maxbs = intval;
1259+
}
12551260
break;
12561261
}
12571262

12581263
case ZFS_PROP_SPECIAL_SMALL_BLOCKS:
12591264
{
1260-
int maxbs = SPA_OLD_MAXBLOCKSIZE;
1265+
int maxbs =
1266+
set_maxbs == 0 ? SPA_OLD_MAXBLOCKSIZE : set_maxbs;
12611267
char buf[64];
12621268

12631269
if (zpool_hdl != NULL) {

0 commit comments

Comments
 (0)