Skip to content

Commit 9b47d37

Browse files
Christoph Hellwigcmaiolino
authored andcommitted
xfs: remove the XBF_STALE check from xfs_buf_rele_cached
xfs_buf_stale already set b_lru_ref to 0, and thus prevents the buffer from moving to the LRU. Remove the duplicate check. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Darrick J. Wong <djwong@kernel.org> Signed-off-by: Carlos Maiolino <cem@kernel.org>
1 parent 0d1120b commit 9b47d37

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

fs/xfs/xfs_buf.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,6 @@ xfs_buf_stale(
9999
*/
100100
bp->b_flags &= ~_XBF_DELWRI_Q;
101101

102-
/*
103-
* Once the buffer is marked stale and unlocked, a subsequent lookup
104-
* could reset b_flags. There is no guarantee that the buffer is
105-
* unaccounted (released to LRU) before that occurs. Drop in-flight
106-
* status now to preserve accounting consistency.
107-
*/
108102
spin_lock(&bp->b_lock);
109103
atomic_set(&bp->b_lru_ref, 0);
110104
if (!(bp->b_state & XFS_BSTATE_DISPOSE) &&
@@ -1033,7 +1027,7 @@ xfs_buf_rele_cached(
10331027
}
10341028

10351029
/* we are asked to drop the last reference */
1036-
if (!(bp->b_flags & XBF_STALE) && atomic_read(&bp->b_lru_ref)) {
1030+
if (atomic_read(&bp->b_lru_ref)) {
10371031
/*
10381032
* If the buffer is added to the LRU, keep the reference to the
10391033
* buffer for the LRU and clear the (now stale) dispose list

0 commit comments

Comments
 (0)