On 2/19/20 8:59 AM, Nikolay Borisov wrote:
On 14.02.20 г. 23:11 ч., Josef Bacik wrote:
I'm going to make the entire destruction of btrfs_root's controlled by
their refcount, so it will be helpful to notice if we're leaking their
eb's on umount.
Signed-off-by: Josef Bacik <josef@xxxxxxxxxxxxxx>
Overall looks good, one minor nit below though:
---
fs/btrfs/ctree.h | 3 +++
fs/btrfs/disk-io.c | 3 +++
fs/btrfs/extent_io.c | 45 ++++++++++++++++++++++----------------------
fs/btrfs/extent_io.h | 7 +++++++
4 files changed, 36 insertions(+), 22 deletions(-)
<snip>
@@ -35,42 +35,45 @@ static inline bool extent_state_in_tree(const struct extent_state *state)
}
#ifdef CONFIG_BTRFS_DEBUG
-static LIST_HEAD(buffers);
static LIST_HEAD(states);
-
static DEFINE_SPINLOCK(leak_lock);
This lock should be renamed to extent_state_leak_lock, otherwise it's
not clear what it protects. I had to through its usage to figure it out.
To take this further, why don't you make it a a per-fs_info lock as
well? Extent states are per fs themselves.
Yeah I can follow up once this set is merged. Thanks,
Josef