]> granicus.if.org Git - zfs/commit
Off-by-one in zap_leaf_array_create()
authorloli10K <loli10K@users.noreply.github.com>
Fri, 18 Jan 2019 17:58:46 +0000 (18:58 +0100)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Fri, 18 Jan 2019 17:58:46 +0000 (09:58 -0800)
commit60b0a963f56182beb2d57823960f3ddb987a584a
treec854c58721add4967aae7c4e864251615c535619
parent8dc2197b7b1e4d7ebc1420ea30e51c6541f1d834
Off-by-one in zap_leaf_array_create()

Trying to set user properties with their length 1 byte shorter than the
maximum size triggers an assertion failure in zap_leaf_array_create():

  panic[cpu0]/thread=ffffff000a092c40:
  assertion failed: num_integers * integer_size < (8<<10) (0x2000 < 0x2000), file: ../../common/fs/zfs/zap_leaf.c, line: 233

  ffffff000a092500 genunix:process_type+167c35 ()
  ffffff000a0925a0 zfs:zap_leaf_array_create+1d2 ()
  ffffff000a092650 zfs:zap_entry_create+1be ()
  ffffff000a092720 zfs:fzap_update+ed ()
  ffffff000a0927d0 zfs:zap_update+1a5 ()
  ffffff000a0928d0 zfs:dsl_prop_set_sync_impl+5c6 ()
  ffffff000a092970 zfs:dsl_props_set_sync_impl+fc ()
  ffffff000a0929b0 zfs:dsl_props_set_sync+79 ()
  ffffff000a0929f0 zfs:dsl_sync_task_sync+10a ()
  ffffff000a092a80 zfs:dsl_pool_sync+3a3 ()
  ffffff000a092b50 zfs:spa_sync+4e6 ()
  ffffff000a092c20 zfs:txg_sync_thread+297 ()
  ffffff000a092c30 unix:thread_start+8 ()

This patch simply corrects the assertion.

Reviewed-by: Matt Ahrens <mahrens@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: loli10K <ezomori.nozomu@gmail.com>
Closes #8278
module/zfs/zap_leaf.c
tests/zfs-tests/tests/functional/cli_root/zfs_set/user_property_001_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_set/user_property_003_neg.ksh