Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 179556
b: refs/heads/master
c: 018027b
h: refs/heads/master
v: v3
  • Loading branch information
Dave Chinner authored and Alex Elder committed Jan 15, 2010
1 parent a48753e commit 9c5111f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 14 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: c8e20be020f234c8d492927a424a7d8bbefd5b5d
refs/heads/master: 018027be90a6946e8cf3f9b17b5582384f7ed117
31 changes: 18 additions & 13 deletions trunk/fs/xfs/linux-2.6/xfs_sync.c
Original file line number Diff line number Diff line change
Expand Up @@ -180,26 +180,31 @@ xfs_sync_inode_valid(
struct xfs_perag *pag)
{
struct inode *inode = VFS_I(ip);
int error = EFSCORRUPTED;

/* nothing to sync during shutdown */
if (XFS_FORCED_SHUTDOWN(ip->i_mount)) {
read_unlock(&pag->pag_ici_lock);
return EFSCORRUPTED;
}
if (XFS_FORCED_SHUTDOWN(ip->i_mount))
goto out_unlock;

/* If we can't get a reference on the inode, it must be in reclaim. */
if (!igrab(inode)) {
read_unlock(&pag->pag_ici_lock);
return ENOENT;
}
read_unlock(&pag->pag_ici_lock);
/* avoid new or reclaimable inodes. Leave for reclaim code to flush */
error = ENOENT;
if (xfs_iflags_test(ip, XFS_INEW | XFS_IRECLAIMABLE | XFS_IRECLAIM))
goto out_unlock;

if (is_bad_inode(inode) || xfs_iflags_test(ip, XFS_INEW)) {
/* If we can't grab the inode, it must on it's way to reclaim. */
if (!igrab(inode))
goto out_unlock;

if (is_bad_inode(inode)) {
IRELE(ip);
return ENOENT;
goto out_unlock;
}

return 0;
/* inode is valid */
error = 0;
out_unlock:
read_unlock(&pag->pag_ici_lock);
return error;
}

STATIC int
Expand Down

0 comments on commit 9c5111f

Please sign in to comment.