Re: [PATCH v2] btrfs: fix integer overflow in calc_reclaim_items_nr

2017-06-23 Thread David Sterba
On Fri, Jun 23, 2017 at 09:48:21AM -0700, Chris Mason wrote: > Dave Jones hit a WARN_ON(nr < 0) in btrfs_wait_ordered_roots() with > v4.12-rc6. This was because commit 70e7af244 made it possible for > calc_reclaim_items_nr() to return a negative number. It's not really a > bug in that commit, it

[PATCH v2] btrfs: fix integer overflow in calc_reclaim_items_nr

2017-06-23 Thread Chris Mason
Dave Jones hit a WARN_ON(nr < 0) in btrfs_wait_ordered_roots() with v4.12-rc6. This was because commit 70e7af244 made it possible for calc_reclaim_items_nr() to return a negative number. It's not really a bug in that commit, it just didn't go far enough down the stack to find all the possible