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.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
return bp;
}
+static inline void
+xfs_buf_delwri_queue(struct xfs_buf *bp, struct list_head *buffer_list)
+{
+ bp->b_node.cn_count++;
+ libxfs_writebuf(bp, 0);
+}
+
#endif /* __LIBXFS_IO_H__ */
#define xfs_buf_relse(bp) libxfs_putbuf(bp)
#define xfs_buf_get(devp,blkno,len) (libxfs_getbuf((devp), (blkno), (len)))
#define xfs_bwrite(bp) libxfs_writebuf((bp), 0)
-#define xfs_buf_delwri_queue(bp, bl) libxfs_writebuf((bp), 0)
#define xfs_buf_delwri_submit(bl) (0)
#define xfs_buf_oneshot(bp) ((void) 0)