Commit 52177937 authored by Mark Tinguely's avatar Mark Tinguely Committed by Dave Chinner

xfs: xfs_iflush_done checks the wrong log item callback

Commit 30136832 ("xfs: remove all the inodes on a buffer from the AIL
in bulk") made the xfs inode flush callback more efficient by
combining all the inode writes on the buffer and the deletions of
the inode log item from AIL.

The initial loop in this patch should be looping through all
the log items on the buffer to see which items have
xfs_iflush_done as their callback function. But currently,
only the log item passed to the function has its callback
compared to xfs_iflush_done. If the log item pointer passed to
the function does have the xfs_iflush_done callback function,
then all the log items on the buffer are removed from the
li_bio_list on the buffer b_fspriv and could be removed from
the AIL even though they may have not been written yet.

This problem is masked by the fact that currently all inodes on a
buffer will have the same calback function - either xfs_iflush_done
or xfs_istale_done - and hence the bug cannot manifest in any way.
Still, we need to remove the landmine so that if we add new
callbacks in future this doesn't cause us problems.
Signed-off-by: default avatarMark Tinguely <tinguely@sgi.com>
Reviewed-by: default avatarDave Chinner <dchinner@redhat.com>
Signed-off-by: default avatarDave Chinner <david@fromorbit.com>
parent da5f1096
...@@ -615,7 +615,7 @@ xfs_iflush_done( ...@@ -615,7 +615,7 @@ xfs_iflush_done(
blip = bp->b_fspriv; blip = bp->b_fspriv;
prev = NULL; prev = NULL;
while (blip != NULL) { while (blip != NULL) {
if (lip->li_cb != xfs_iflush_done) { if (blip->li_cb != xfs_iflush_done) {
prev = blip; prev = blip;
blip = blip->li_bio_list; blip = blip->li_bio_list;
continue; continue;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment