]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commit
xfs: remove unnecessary dirty bli format check for ordered bufs
authorBrian Foster <bfoster@redhat.com>
Sun, 17 Sep 2017 21:06:19 +0000 (14:06 -0700)
committerSeth Forshee <seth.forshee@canonical.com>
Wed, 20 Sep 2017 12:31:59 +0000 (07:31 -0500)
commit56266d7a3683e11c5deea5409f5c339ece331aa2
tree508e883f1aaa9bc7c8b759f69ca87c7ab95adb69
parent0571592745b2935d9ce2bca0091652072a4cce04
xfs: remove unnecessary dirty bli format check for ordered bufs

BugLink: http://bugs.launchpad.net/bugs/1718412
commit 6453c65d3576bc3e602abb5add15f112755c08ca upstream.

xfs_buf_item_unlock() historically checked the dirty state of the
buffer by manually checking the buffer log formats for dirty
segments. The introduction of ordered buffers invalidated this check
because ordered buffers have dirty bli's but no dirty (logged)
segments. The check was updated to accommodate ordered buffers by
looking at the bli state first and considering the blf only if the
bli is clean.

This logic is safe but unnecessary. There is no valid case where the
bli is clean yet the blf has dirty segments. The bli is set dirty
whenever the blf is logged (via xfs_trans_log_buf()) and the blf is
cleared in the only place BLI_DIRTY is cleared (xfs_trans_binval()).

Remove the conditional blf dirty checks and replace with an assert
that should catch any discrepencies between bli and blf dirty
states. Refactor the old blf dirty check into a helper function to
be used by the assert.

Signed-off-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
fs/xfs/xfs_buf_item.c
fs/xfs/xfs_buf_item.h