On Thu, Jul 02, 2020 at 09:28:30AM -0400, Josef Bacik wrote:
> On 7/1/20 8:14 PM, Qu Wenruo wrote:
> > Since commit c6887cd11149 ("Btrfs: don't do nocow check unless we have to"),
> > btrfs/153 always fails with early EDQUOT.
> >
> > This is caused by the fact that:
> > - We always reserved data space for even NODATACOW buffered write
> > This is mostly to improve performance, and not pratical to revert.
> >
> > - Btrfs qgroup data and meta reserved space share the same limit
> > So it's not ensured to return EDQUOT just for that data reservation,
> > metadata reservation can also get EDQUOT, means we can't go the same
> > solution as that commit.
> >
> > This patchset will solve it by doing extra qgroup space flushing when
> > EDQUOT is hit.
> >
> > This is a little like what we do in ticketing space reservation system,
> > but since there are very limited ways for qgroup to reclaim space,
> > currently it's still handled in qgroup realm, not reusing the ticketing
> > system yet.
> >
> > By this, this patch could solve the btrfs/153 problem, while still keep
> > btrfs qgroup space usage under the limit.
> >
> > The only cost is, when we're near qgroup limit, we will cause more dirty
> > inodes flush and transaction commit, much like what we do when the
> > metadata space is near exhausted.
> > So the cost should be still acceptable.
>
> This patchset fails to apply on misc-next as of
>
> btrfs: allow use of global block reserve for balance item deletion
That's about 50 patches behind some recent snapshot of misc-next, the
patches apply cleanly for me here.