diff options
Diffstat (limited to 'fs/xfs/xfs_ialloc.c')
-rw-r--r-- | fs/xfs/xfs_ialloc.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/fs/xfs/xfs_ialloc.c b/fs/xfs/xfs_ialloc.c index 0c946c8e05da..d8fd36685eb9 100644 --- a/fs/xfs/xfs_ialloc.c +++ b/fs/xfs/xfs_ialloc.c | |||
@@ -1251,7 +1251,7 @@ xfs_imap_lookup( | |||
1251 | return error; | 1251 | return error; |
1252 | 1252 | ||
1253 | /* for untrusted inodes check it is allocated first */ | 1253 | /* for untrusted inodes check it is allocated first */ |
1254 | if ((flags & XFS_IGET_BULKSTAT) && | 1254 | if ((flags & XFS_IGET_UNTRUSTED) && |
1255 | (rec.ir_free & XFS_INOBT_MASK(agino - rec.ir_startino))) | 1255 | (rec.ir_free & XFS_INOBT_MASK(agino - rec.ir_startino))) |
1256 | return EINVAL; | 1256 | return EINVAL; |
1257 | 1257 | ||
@@ -1292,8 +1292,11 @@ xfs_imap( | |||
1292 | if (agno >= mp->m_sb.sb_agcount || agbno >= mp->m_sb.sb_agblocks || | 1292 | if (agno >= mp->m_sb.sb_agcount || agbno >= mp->m_sb.sb_agblocks || |
1293 | ino != XFS_AGINO_TO_INO(mp, agno, agino)) { | 1293 | ino != XFS_AGINO_TO_INO(mp, agno, agino)) { |
1294 | #ifdef DEBUG | 1294 | #ifdef DEBUG |
1295 | /* no diagnostics for bulkstat, ino comes from userspace */ | 1295 | /* |
1296 | if (flags & XFS_IGET_BULKSTAT) | 1296 | * Don't output diagnostic information for untrusted inodes |
1297 | * as they can be invalid without implying corruption. | ||
1298 | */ | ||
1299 | if (flags & XFS_IGET_UNTRUSTED) | ||
1297 | return XFS_ERROR(EINVAL); | 1300 | return XFS_ERROR(EINVAL); |
1298 | if (agno >= mp->m_sb.sb_agcount) { | 1301 | if (agno >= mp->m_sb.sb_agcount) { |
1299 | xfs_fs_cmn_err(CE_ALERT, mp, | 1302 | xfs_fs_cmn_err(CE_ALERT, mp, |
@@ -1329,7 +1332,7 @@ xfs_imap( | |||
1329 | * inodes in stale state on disk. Hence we have to do a btree lookup | 1332 | * inodes in stale state on disk. Hence we have to do a btree lookup |
1330 | * in all cases where an untrusted inode number is passed. | 1333 | * in all cases where an untrusted inode number is passed. |
1331 | */ | 1334 | */ |
1332 | if (flags & XFS_IGET_BULKSTAT) { | 1335 | if (flags & XFS_IGET_UNTRUSTED) { |
1333 | error = xfs_imap_lookup(mp, tp, agno, agino, agbno, | 1336 | error = xfs_imap_lookup(mp, tp, agno, agino, agbno, |
1334 | &chunk_agbno, &offset_agbno, flags); | 1337 | &chunk_agbno, &offset_agbno, flags); |
1335 | if (error) | 1338 | if (error) |