Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 200782
b: refs/heads/master
c: 1920779
h: refs/heads/master
v: v3
  • Loading branch information
Dave Chinner authored and Dave Chinner committed Jun 24, 2010
1 parent a600de6 commit 16d448a
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 13 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: 7124fe0a5b619d65b739477b3b55a20bf805b06d
refs/heads/master: 1920779e67cbf5ea8afef317777c5bf2b8096188
9 changes: 4 additions & 5 deletions trunk/fs/xfs/linux-2.6/xfs_export.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,12 +128,11 @@ xfs_nfs_get_inode(
return ERR_PTR(-ESTALE);

/*
* The XFS_IGET_BULKSTAT means that an invalid inode number is just
* fine and not an indication of a corrupted filesystem. Because
* clients can send any kind of invalid file handle, e.g. after
* a restore on the server we have to deal with this case gracefully.
* The XFS_IGET_UNTRUSTED means that an invalid inode number is just
* fine and not an indication of a corrupted filesystem as clients can
* send invalid file handles and we have to handle it gracefully..
*/
error = xfs_iget(mp, NULL, ino, XFS_IGET_BULKSTAT,
error = xfs_iget(mp, NULL, ino, XFS_IGET_UNTRUSTED,
XFS_ILOCK_SHARED, &ip, 0);
if (error) {
/*
Expand Down
11 changes: 7 additions & 4 deletions trunk/fs/xfs/xfs_ialloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1251,7 +1251,7 @@ xfs_imap_lookup(
return error;

/* for untrusted inodes check it is allocated first */
if ((flags & XFS_IGET_BULKSTAT) &&
if ((flags & XFS_IGET_UNTRUSTED) &&
(rec.ir_free & XFS_INOBT_MASK(agino - rec.ir_startino)))
return EINVAL;

Expand Down Expand Up @@ -1292,8 +1292,11 @@ xfs_imap(
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_IGET_BULKSTAT)
/*
* Don't output diagnostic information for untrusted inodes
* as they can be invalid without implying corruption.
*/
if (flags & XFS_IGET_UNTRUSTED)
return XFS_ERROR(EINVAL);
if (agno >= mp->m_sb.sb_agcount) {
xfs_fs_cmn_err(CE_ALERT, mp,
Expand Down Expand Up @@ -1329,7 +1332,7 @@ xfs_imap(
* inodes in stale state on disk. Hence we have to do a btree lookup
* in all cases where an untrusted inode number is passed.
*/
if (flags & XFS_IGET_BULKSTAT) {
if (flags & XFS_IGET_UNTRUSTED) {
error = xfs_imap_lookup(mp, tp, agno, agino, agbno,
&chunk_agbno, &offset_agbno, flags);
if (error)
Expand Down
2 changes: 1 addition & 1 deletion trunk/fs/xfs/xfs_inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ xfs_imap_to_bp(
if (unlikely(XFS_TEST_ERROR(!di_ok, mp,
XFS_ERRTAG_ITOBP_INOTOBP,
XFS_RANDOM_ITOBP_INOTOBP))) {
if (iget_flags & XFS_IGET_BULKSTAT) {
if (iget_flags & XFS_IGET_UNTRUSTED) {
xfs_trans_brelse(tp, bp);
return XFS_ERROR(EINVAL);
}
Expand Down
2 changes: 1 addition & 1 deletion trunk/fs/xfs/xfs_inode.h
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ do { \
* Flags for xfs_iget()
*/
#define XFS_IGET_CREATE 0x1
#define XFS_IGET_BULKSTAT 0x2
#define XFS_IGET_UNTRUSTED 0x2

int xfs_inotobp(struct xfs_mount *, struct xfs_trans *,
xfs_ino_t, struct xfs_dinode **,
Expand Down
2 changes: 1 addition & 1 deletion trunk/fs/xfs/xfs_itable.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ xfs_bulkstat_one_int(
return XFS_ERROR(ENOMEM);

error = xfs_iget(mp, NULL, ino,
XFS_IGET_BULKSTAT, XFS_ILOCK_SHARED, &ip, bno);
XFS_IGET_UNTRUSTED, XFS_ILOCK_SHARED, &ip, bno);
if (error) {
*stat = BULKSTAT_RV_NOTHING;
goto out_free;
Expand Down

0 comments on commit 16d448a

Please sign in to comment.