[PATCH] Btrfs: use a percpu to keep track of possibly pinned bytes V2

2013-06-20 Thread Josef Bacik
There are all of these checks in the ENOSPC code to see if committing the transaction would free up enough space to make the allocation. This is because early on we just committed the transaction and hoped and prayed, which resulted in cases where it took _forever_ to get an ENOSPC when we really

Re: [PATCH] Btrfs: use a percpu to keep track of possibly pinned bytes

2013-06-20 Thread Josef Bacik
On Thu, Jun 20, 2013 at 09:26:15AM -0700, Zach Brown wrote: > > @@ -3380,6 +3382,10 @@ static int update_space_info(struct btrfs_fs_info > > *info, u64 flags, > > if (!found) > > return -ENOMEM; > > > > + ret = percpu_counter_init(&found->total_bytes_pinned, 0); > > + if (ret

Re: [PATCH] Btrfs: use a percpu to keep track of possibly pinned bytes

2013-06-20 Thread Zach Brown
> @@ -3380,6 +3382,10 @@ static int update_space_info(struct btrfs_fs_info > *info, u64 flags, > if (!found) > return -ENOMEM; > > + ret = percpu_counter_init(&found->total_bytes_pinned, 0); > + if (ret) > + return ret; > + Leaks *found if percpu_counter_

[PATCH] Btrfs: use a percpu to keep track of possibly pinned bytes

2013-06-19 Thread Josef Bacik
There are all of these checks in the ENOSPC code to see if committing the transaction would free up enough space to make the allocation. This is because early on we just committed the transaction and hoped and prayed, which resulted in cases where it took _forever_ to get an ENOSPC when we really