Re: [PATCH] xfs: hold xfs_buf locked between shortform->leaf conversion and the addition of an attribute
From: Christoph Hellwig <hch@infradead.org>
Date: 2017-08-11 12:53:13
From: Christoph Hellwig <hch@infradead.org>
Date: 2017-08-11 12:53:13
On Thu, Aug 10, 2017 at 07:33:07AM +1000, Dave Chinner wrote:
Hmmmm, looking closer at xfs_defer_finish(), just holding the buffer here isn't sufficient. xfs_defer_finish() can roll the transaction a number of times and holding the buffer is a one-shot deal. Hence the buffer held buffer will have BLI_HOLD removed on the next commit and be unlocked by the second commit, whether it be inside xfs_defer_finish() or the roll that occurs below. ISTR a previous discussion with Darrick that we needed something like xfs_defer_join() with buffers instead of inodes to allow them to be held across a call to xfs_defer_finish()....
We do. I actually have patches lying around that remove the xfs_trans_roll and xfs_defer_finish inode arguments, and instead have a separate helper for rolling over an inode and adding an inode to the defer list. I've not added a magic helper for buffers yet, but that would be a natural fit into that model.