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
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
> @@ -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_
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