xfs: fix error handling at xfs_bulkstat
From: Jie Liu <jeff.liu@oracle.com> We should not ignore the btree operation errors at xfs_bulkstat() but to propagate them if any. This patch fix two places in this function and the remaining things will be fixed with code refactoring thereafter. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jie Liu <jeff.liu@oracle.com> Reviewed-by: Dave Chinner <dchinner@redhat.com> Signed-off-by: Dave Chinner <david@fromorbit.com>
This commit is contained in:
parent
296dfd7fdb
commit
d4c2734875
@ -253,14 +253,8 @@ xfs_bulkstat(
|
|||||||
while (XFS_BULKSTAT_UBLEFT(ubleft) && agno < mp->m_sb.sb_agcount) {
|
while (XFS_BULKSTAT_UBLEFT(ubleft) && agno < mp->m_sb.sb_agcount) {
|
||||||
cond_resched();
|
cond_resched();
|
||||||
error = xfs_ialloc_read_agi(mp, NULL, agno, &agbp);
|
error = xfs_ialloc_read_agi(mp, NULL, agno, &agbp);
|
||||||
if (error) {
|
if (error)
|
||||||
/*
|
break;
|
||||||
* Skip this allocation group and go to the next one.
|
|
||||||
*/
|
|
||||||
agno++;
|
|
||||||
agino = 0;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
agi = XFS_BUF_TO_AGI(agbp);
|
agi = XFS_BUF_TO_AGI(agbp);
|
||||||
/*
|
/*
|
||||||
* Allocate and initialize a btree cursor for ialloc btree.
|
* Allocate and initialize a btree cursor for ialloc btree.
|
||||||
@ -332,34 +326,15 @@ xfs_bulkstat(
|
|||||||
error = xfs_inobt_lookup(cur, 0, XFS_LOOKUP_GE, &tmp);
|
error = xfs_inobt_lookup(cur, 0, XFS_LOOKUP_GE, &tmp);
|
||||||
icount = 0;
|
icount = 0;
|
||||||
}
|
}
|
||||||
|
if (error)
|
||||||
|
break;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Loop through inode btree records in this ag,
|
* Loop through inode btree records in this ag,
|
||||||
* until we run out of inodes or space in the buffer.
|
* until we run out of inodes or space in the buffer.
|
||||||
*/
|
*/
|
||||||
while (irbp < irbufend && icount < ubcount) {
|
while (irbp < irbufend && icount < ubcount) {
|
||||||
xfs_inobt_rec_incore_t r;
|
struct xfs_inobt_rec_incore r;
|
||||||
|
|
||||||
/*
|
|
||||||
* Loop as long as we're unable to read the
|
|
||||||
* inode btree.
|
|
||||||
*/
|
|
||||||
while (error) {
|
|
||||||
agino += XFS_INODES_PER_CHUNK;
|
|
||||||
if (XFS_AGINO_TO_AGBNO(mp, agino) >=
|
|
||||||
be32_to_cpu(agi->agi_length))
|
|
||||||
break;
|
|
||||||
error = xfs_inobt_lookup(cur, agino,
|
|
||||||
XFS_LOOKUP_GE, &tmp);
|
|
||||||
cond_resched();
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
* If ran off the end of the ag either with an error,
|
|
||||||
* or the normal way, set end and stop collecting.
|
|
||||||
*/
|
|
||||||
if (error) {
|
|
||||||
end_of_ag = 1;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
error = xfs_inobt_get_rec(cur, &r, &i);
|
error = xfs_inobt_get_rec(cur, &r, &i);
|
||||||
if (error || i == 0) {
|
if (error || i == 0) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user