Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 352922
b: refs/heads/master
c: 10616b8
h: refs/heads/master
v: v3
  • Loading branch information
Dave Chinner authored and Ben Myers committed Jan 24, 2013
1 parent 6e87681 commit 41e5888
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 003fd6c8be14a348c56cb1d171605ab13fca906f
refs/heads/master: 10616b806d1d7835b1d23b8d75ef638f92cb98b6
18 changes: 18 additions & 0 deletions trunk/fs/xfs/xfs_buf.c
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,7 @@ _xfs_buf_find(
struct rb_node *parent;
xfs_buf_t *bp;
xfs_daddr_t blkno = map[0].bm_bn;
xfs_daddr_t eofs;
int numblks = 0;
int i;

Expand All @@ -498,6 +499,23 @@ _xfs_buf_find(
ASSERT(!(numbytes < (1 << btp->bt_sshift)));
ASSERT(!(BBTOB(blkno) & (xfs_off_t)btp->bt_smask));

/*
* Corrupted block numbers can get through to here, unfortunately, so we
* have to check that the buffer falls within the filesystem bounds.
*/
eofs = XFS_FSB_TO_BB(btp->bt_mount, btp->bt_mount->m_sb.sb_dblocks);
if (blkno >= eofs) {
/*
* XXX (dgc): we should really be returning EFSCORRUPTED here,
* but none of the higher level infrastructure supports
* returning a specific error on buffer lookup failures.
*/
xfs_alert(btp->bt_mount,
"%s: Block out of range: block 0x%llx, EOFS 0x%llx ",
__func__, blkno, eofs);
return NULL;
}

/* get tree root */
pag = xfs_perag_get(btp->bt_mount,
xfs_daddr_to_agno(btp->bt_mount, blkno));
Expand Down

0 comments on commit 41e5888

Please sign in to comment.