[Top] [All Lists]

TAKE 988142 - Prevent looping in xfs_sync_inodes_ag

To: sgi.bugs.xfs@xxxxxxxxxxxx, xfs@xxxxxxxxxxx
Subject: TAKE 988142 - Prevent looping in xfs_sync_inodes_ag
From: lachlan@xxxxxxx (Lachlan McIlroy)
Date: Wed, 15 Oct 2008 16:16:46 +1100 (EST)
Prevent looping in xfs_sync_inodes_ag

If the last  block of the AG has inodes in it and the AG is an
exactly power-of-2 size then the last inode in the AG points
to the last block in the AG. If we try to find the next inode
in the AG by adding one to the inode number, we increment the
inode number past the size of the AG. The result is that the
macro XFS_INO_TO_AGINO() will strip the AG portion of the inode
number and return an inode number of zero.

That is, instead of terminating the lookup loop because we hit the
inode number went outside the valid range for the AG, the search
index returns to zero and we start traversing the radix tree from
the start again. This results in an endless loop in

Fix it be detecting if the new search index decreases as a result of
incrementing the current inode number. That indicate an overflow and
hence that we have finished processing the AG so we can terminate
the loop.

Signed-off-by: Dave Chinner <david@xxxxxxxxxxxxx>

Date:  Wed Oct 15 16:16:29 EST 2008
Workarea:  redback.melbourne.sgi.com:/home/lachlan/isms/2.6.x-reclaim
Inspected by:  hch
Author:  lachlan

The following file(s) were checked into:

Modid:  xfs-linux-melb:xfs-kern:32335a
fs/xfs/linux-2.6/xfs_sync.c - 1.23 - changed
        - Prevent looping in xfs_sync_inodes_ag

<Prev in Thread] Current Thread [Next in Thread>
  • TAKE 988142 - Prevent looping in xfs_sync_inodes_ag, Lachlan McIlroy <=