]> git.proxmox.com Git - mirror_zfs.git/commit - module/zfs/dmu_objset.c
Fix userquota_compare() function
authorBrian Behlendorf <behlendorf1@llnl.gov>
Fri, 21 Oct 2016 15:23:27 +0000 (08:23 -0700)
committerGitHub <noreply@github.com>
Fri, 21 Oct 2016 15:23:27 +0000 (08:23 -0700)
commite4ffa98dcaf2208c742609f0ab2bdb343071446a
tree8b60321630f98db86dac20ad4e66a24372fcd409
parent9523b15ac1881946a7a6b7a145c8e2bb622dc56c
Fix userquota_compare() function

The AVL tree compare function requires that either -1, 0, or 1 be
returned.  However the strcmp() function only guarantees that a
negative, zero, or positive value is returned.  Therefore, the
return value of strcmp() needs to be sanitized with AVL_ISIGN.

This was initially overlooked because the x86_64 implementation
of strcmp() happens to only returns the allowed values.  This
was observed on an aarch64 platform which behaves correctly but
differently as described above.

Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Reviewed-by: Richard Laager <rlaager@wiktel.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #5311
Closes #5313
module/zfs/dmu_objset.c