]> git.proxmox.com Git - mirror_zfs.git/commit - module/zfs/zfs_dir.c
Use zap_count instead of cached z_size for unlink
authorAlex Zhuravlev <alexey.zhuravlev@intel.com>
Mon, 8 Jan 2018 18:57:47 +0000 (10:57 -0800)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Wed, 10 Jan 2018 00:16:07 +0000 (16:16 -0800)
commit3910184d9ecf187f5f229798bab688d754fa1e30
tree4d1d0a9f6352c93dc33ff55dc70b03ae701552e5
parentcba6fc61a2898395c47380a0c2303f19842a2ff0
Use zap_count instead of cached z_size for unlink

As a performance optimization Lustre does not strictly update
the SA_ZPL_SIZE when adding/removing from non-directory entries.
This results in entries which cannot be removed through the ZPL
layer even though the ZAP is empty and safe to remove.

Resolve this issue by checking the zap_count() directly instead
on relying on the cached SA_ZPL_SIZE.  Micro-benchmarks show no
significant performance impact due to the additional overhead
of using zap_count().

Reviewed-by: Olaf Faaland <faaland1@llnl.gov>
Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Signed-off-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #7019
module/zfs/zfs_dir.c