btrfs: use correct compare function of dirty_metadata_bytes
authorEthan Lien <ethanlien@synology.com>
Mon, 2 Jul 2018 07:44:58 +0000 (15:44 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 15 Sep 2018 07:43:06 +0000 (09:43 +0200)
commitd92fa5e18a42ef9d88473ff7fd99dce68b808a6c
tree58fba72065857815b371350f4dcbeb747f029134
parentd1f7cdc0db808f16e5ac43a454affc8e6a5ebc2e
btrfs: use correct compare function of dirty_metadata_bytes

commit d814a49198eafa6163698bdd93961302f3a877a4 upstream.

We use customized, nodesize batch value to update dirty_metadata_bytes.
We should also use batch version of compare function or we will easily
goto fast path and get false result from percpu_counter_compare().

Fixes: e2d845211eda ("Btrfs: use percpu counter for dirty metadata count")
CC: stable@vger.kernel.org # 4.4+
Signed-off-by: Ethan Lien <ethanlien@synology.com>
Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
nb: Rebased on 4.4.y ]
Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/btrfs/disk-io.c