aboutsummaryrefslogtreecommitdiffstats
path: root/module
diff options
context:
space:
mode:
authorloli10K <[email protected]>2019-02-08 21:32:12 +0100
committerMatthew Ahrens <[email protected]>2019-02-08 12:32:12 -0800
commit4417096956f7439322c65d9e70a4526df45ea8d0 (patch)
tree178e2f569132f796e7e724711be9a681671608c0 /module
parent0902c4577f4ba2a3687549f7d5d19718a275fb52 (diff)
Pool allocation classes misplacing small file blocks
Due to an off-by-one condition in spa_preferred_class() we are picking the "normal" allocation class instead of the "special" one for file blocks with size equal to the special_small_blocks property value. This change fix the small code issue, update the ZFS Test Suite and the zfs(8) man page. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Don Brady <[email protected]> Signed-off-by: loli10K <[email protected]> Closes #8351 Closes #8361
Diffstat (limited to 'module')
-rw-r--r--module/zfs/spa_misc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/module/zfs/spa_misc.c b/module/zfs/spa_misc.c
index 877f312b1..0976cc49c 100644
--- a/module/zfs/spa_misc.c
+++ b/module/zfs/spa_misc.c
@@ -1851,7 +1851,7 @@ spa_preferred_class(spa_t *spa, uint64_t size, dmu_object_type_t objtype,
* zfs_special_class_metadata_reserve_pct exclusively for metadata.
*/
if (DMU_OT_IS_FILE(objtype) &&
- has_special_class && size < special_smallblk) {
+ has_special_class && size <= special_smallblk) {
metaslab_class_t *special = spa_special_class(spa);
uint64_t alloc = metaslab_class_get_alloc(special);
uint64_t space = metaslab_class_get_space(special);