Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 28435
b: refs/heads/master
c: 4d1a2ed
h: refs/heads/master
i:
  28433: deaad64
  28431: 1df5f01
v: v3
  • Loading branch information
Nathan Scott committed Jun 9, 2006
1 parent eea2699 commit 268c597
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a916e2bd15b7572d9e791ae2a9333f74175470cd
refs/heads/master: 4d1a2ed3d8d6e306d20f5d99a5ae12ac4c8b787b
3 changes: 3 additions & 0 deletions trunk/fs/xfs/xfs_ialloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1174,6 +1174,9 @@ xfs_dilocate(
if (agno >= mp->m_sb.sb_agcount || agbno >= mp->m_sb.sb_agblocks ||
ino != XFS_AGINO_TO_INO(mp, agno, agino)) {
#ifdef DEBUG
/* no diagnostics for bulkstat, ino comes from userspace */
if (flags & XFS_IMAP_BULKSTAT)
return XFS_ERROR(EINVAL);
if (agno >= mp->m_sb.sb_agcount) {
xfs_fs_cmn_err(CE_ALERT, mp,
"xfs_dilocate: agno (%d) >= "
Expand Down
22 changes: 12 additions & 10 deletions trunk/fs/xfs/xfs_inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -256,13 +256,11 @@ xfs_itobp(
xfs_daddr_t bno,
uint imap_flags)
{
xfs_imap_t imap;
xfs_buf_t *bp;
int error;
xfs_imap_t imap;
#ifdef __KERNEL__
int i;
int ni;
#endif

if (ip->i_blkno == (xfs_daddr_t)0) {
/*
Expand Down Expand Up @@ -319,7 +317,6 @@ xfs_itobp(
*/
error = xfs_trans_read_buf(mp, tp, mp->m_ddev_targp, imap.im_blkno,
(int)imap.im_len, XFS_BUF_LOCK, &bp);

if (error) {
#ifdef DEBUG
xfs_fs_cmn_err(CE_ALERT, mp, "xfs_itobp: "
Expand All @@ -330,17 +327,21 @@ xfs_itobp(
#endif /* DEBUG */
return error;
}
#ifdef __KERNEL__

/*
* Validate the magic number and version of every inode in the buffer
* (if DEBUG kernel) or the first inode in the buffer, otherwise.
* No validation is done here in userspace (xfs_repair).
*/
#ifdef DEBUG
#if !defined(__KERNEL__)
ni = 0;
#elif defined(DEBUG)
ni = (imap_flags & XFS_IMAP_BULKSTAT) ? 0 :
(BBTOB(imap.im_len) >> mp->m_sb.sb_inodelog);
#else
#else /* usual case */
ni = (imap_flags & XFS_IMAP_BULKSTAT) ? 0 : 1;
#endif

for (i = 0; i < ni; i++) {
int di_ok;
xfs_dinode_t *dip;
Expand All @@ -352,8 +353,10 @@ xfs_itobp(
if (unlikely(XFS_TEST_ERROR(!di_ok, mp, XFS_ERRTAG_ITOBP_INOTOBP,
XFS_RANDOM_ITOBP_INOTOBP))) {
#ifdef DEBUG
cmn_err(CE_ALERT, "Device %s - bad inode magic/vsn "
"daddr %lld #%d (magic=%x)",
if (!(imap_flags & XFS_IMAP_BULKSTAT))
cmn_err(CE_ALERT,
"Device %s - bad inode magic/vsn "
"daddr %lld #%d (magic=%x)",
XFS_BUFTARG_NAME(mp->m_ddev_targp),
(unsigned long long)imap.im_blkno, i,
INT_GET(dip->di_core.di_magic, ARCH_CONVERT));
Expand All @@ -364,7 +367,6 @@ xfs_itobp(
return XFS_ERROR(EFSCORRUPTED);
}
}
#endif /* __KERNEL__ */

xfs_inobp_check(mp, bp);

Expand Down

0 comments on commit 268c597

Please sign in to comment.