]> git.proxmox.com Git - mirror_zfs.git/commit
Don't dirty bpobj if it has no entries
authorAlek P <alek-p@users.noreply.github.com>
Fri, 26 May 2017 18:42:10 +0000 (08:42 -1000)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Fri, 26 May 2017 18:42:10 +0000 (11:42 -0700)
commit9210e43a1660bd1b742e80bfc121b86e2cfad57a
tree039fdf97c5afca8ab66f40bbe34ca882f9653d0f
parent261c013fbf79431ac79def2cdf56d9d82009cd4d
Don't dirty bpobj if it has no entries

In certain cases (dsl_scan_sync() is one), we may end up calling
bpobj_iterate() on an empty bpobj. Even though we don't end up
modifying the bpobj it still gets dirtied, causing unneeded writes
to the pool.

This patch adds an early bail from bpobj_iterate_impl() if bpobj
is empty to prevent unneeded writes.

Reviewed-by: George Melikov <mail@gmelikov.ru>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Signed-off-by: Alek Pinchuk <apinchuk@datto.com>
Closes #6164
module/zfs/bpobj.c