On Fri, Jun 21, 2019 at 12:57:24PM -0700, Darrick J. Wong wrote: > From: Darrick J. Wong <darrick.wong@xxxxxxxxxx> > > In the kernel, xfs_buf_delwri_queue increments the buffer reference > count before putting the buffer on the buffer list, and the refcount is > decremented after the io completes for a net refcount change of zero. > > In userspace, delwri_queue calls libxfs_writebuf, which puts the buffer. > delwri_queue is a no-op, for a net refcount change of -1. This creates > problems for any callers that expect a net change of zero, so increment > the buffer refcount before calling writebuf. Looks good, Reviewed-by: Christoph Hellwig <hch@xxxxxx>