summaryrefslogtreecommitdiffstats
path: root/fs/xfs/libxfs/xfs_defer.h
diff options
context:
space:
mode:
authorDarrick J. Wong <darrick.wong@oracle.com>2016-08-30 13:51:39 +1000
committerDave Chinner <david@fromorbit.com>2016-08-30 13:51:39 +1000
commitea78d80866ce375defb2fdd1c8a3aafec95e0f85 (patch)
tree5d0f6cbaf755b530f5044f2aee0f37bb7a3b5ff5 /fs/xfs/libxfs/xfs_defer.h
parent17de0a9ff3df8f54f2f47746d118112d4e61d973 (diff)
downloadop-kernel-dev-ea78d80866ce375defb2fdd1c8a3aafec95e0f85.zip
op-kernel-dev-ea78d80866ce375defb2fdd1c8a3aafec95e0f85.tar.gz
xfs: track log done items directly in the deferred pending work item
Christoph reports slab corruption when a deferred refcount update aborts during _defer_finish(). The cause of this was broken log item state tracking in xfs_defer_pending -- upon an abort, _defer_trans_abort() will call abort_intent on all intent items, including the ones that have already had a done item attached. This is incorrect because each intent item has 2 refcount: the first is released when the intent item is committed to the log; and the second is released when the _done_ item is committed to the log, or by the intent creator if there is no done item. In other words, once we log the done item, responsibility for releasing the intent item's second refcount is transferred to the done item and /must not/ be performed by anything else. The dfp_committed flag should have been tracking whether or not we had a done item so that _defer_trans_abort could decide if it needs to abort the intent item, but due to a thinko this was not the case. Rip it out and track the done item directly so that we do the right thing w.r.t. intent item freeing. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Reported-by: Christoph Hellwig <hch@infradead.org> Reviewed-by: Dave Chinner <dchinner@redhat.com> Signed-off-by: Dave Chinner <david@fromorbit.com>
Diffstat (limited to 'fs/xfs/libxfs/xfs_defer.h')
-rw-r--r--fs/xfs/libxfs/xfs_defer.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/xfs/libxfs/xfs_defer.h b/fs/xfs/libxfs/xfs_defer.h
index cc3981c..e96533d 100644
--- a/fs/xfs/libxfs/xfs_defer.h
+++ b/fs/xfs/libxfs/xfs_defer.h
@@ -30,8 +30,8 @@ struct xfs_defer_op_type;
struct xfs_defer_pending {
const struct xfs_defer_op_type *dfp_type; /* function pointers */
struct list_head dfp_list; /* pending items */
- bool dfp_committed; /* committed trans? */
void *dfp_intent; /* log intent item */
+ void *dfp_done; /* log done item */
struct list_head dfp_work; /* work items */
unsigned int dfp_count; /* # extent items */
};
OpenPOWER on IntegriCloud