xfs: xfs_iflush_cluster has range issues
xfs_iflush_cluster() does a gang lookup on the radix tree, meaning it can find inodes beyond the current cluster if there is sparse cache population. gang lookups return results in ascending index order, so stop trying to cluster inodes once the first inode outside the cluster mask is detected. Signed-off-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Brian Foster <bfoster@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Dave Chinner <david@fromorbit.com>
This commit is contained in:
Родитель
8a17d7dded
Коммит
5a90e53e81
|
@ -3207,11 +3207,20 @@ xfs_iflush_cluster(
|
||||||
*/
|
*/
|
||||||
spin_lock(&iq->i_flags_lock);
|
spin_lock(&iq->i_flags_lock);
|
||||||
if (!iq->i_ino ||
|
if (!iq->i_ino ||
|
||||||
__xfs_iflags_test(iq, XFS_ISTALE) ||
|
__xfs_iflags_test(iq, XFS_ISTALE)) {
|
||||||
(XFS_INO_TO_AGINO(mp, iq->i_ino) & mask) != first_index) {
|
|
||||||
spin_unlock(&iq->i_flags_lock);
|
spin_unlock(&iq->i_flags_lock);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Once we fall off the end of the cluster, no point checking
|
||||||
|
* any more inodes in the list because they will also all be
|
||||||
|
* outside the cluster.
|
||||||
|
*/
|
||||||
|
if ((XFS_INO_TO_AGINO(mp, iq->i_ino) & mask) != first_index) {
|
||||||
|
spin_unlock(&iq->i_flags_lock);
|
||||||
|
break;
|
||||||
|
}
|
||||||
spin_unlock(&iq->i_flags_lock);
|
spin_unlock(&iq->i_flags_lock);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Загрузка…
Ссылка в новой задаче