diff options
Diffstat (limited to 'fs/xfs/linux-2.6/xfs_sync.c')
-rw-r--r-- | fs/xfs/linux-2.6/xfs_sync.c | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/fs/xfs/linux-2.6/xfs_sync.c b/fs/xfs/linux-2.6/xfs_sync.c index e19d25555c3f..1f5e4bb5e970 100644 --- a/fs/xfs/linux-2.6/xfs_sync.c +++ b/fs/xfs/linux-2.6/xfs_sync.c | |||
@@ -180,26 +180,31 @@ xfs_sync_inode_valid( | |||
180 | struct xfs_perag *pag) | 180 | struct xfs_perag *pag) |
181 | { | 181 | { |
182 | struct inode *inode = VFS_I(ip); | 182 | struct inode *inode = VFS_I(ip); |
183 | int error = EFSCORRUPTED; | ||
183 | 184 | ||
184 | /* nothing to sync during shutdown */ | 185 | /* nothing to sync during shutdown */ |
185 | if (XFS_FORCED_SHUTDOWN(ip->i_mount)) { | 186 | if (XFS_FORCED_SHUTDOWN(ip->i_mount)) |
186 | read_unlock(&pag->pag_ici_lock); | 187 | goto out_unlock; |
187 | return EFSCORRUPTED; | ||
188 | } | ||
189 | 188 | ||
190 | /* If we can't get a reference on the inode, it must be in reclaim. */ | 189 | /* avoid new or reclaimable inodes. Leave for reclaim code to flush */ |
191 | if (!igrab(inode)) { | 190 | error = ENOENT; |
192 | read_unlock(&pag->pag_ici_lock); | 191 | if (xfs_iflags_test(ip, XFS_INEW | XFS_IRECLAIMABLE | XFS_IRECLAIM)) |
193 | return ENOENT; | 192 | goto out_unlock; |
194 | } | ||
195 | read_unlock(&pag->pag_ici_lock); | ||
196 | 193 | ||
197 | if (is_bad_inode(inode) || xfs_iflags_test(ip, XFS_INEW)) { | 194 | /* If we can't grab the inode, it must on it's way to reclaim. */ |
195 | if (!igrab(inode)) | ||
196 | goto out_unlock; | ||
197 | |||
198 | if (is_bad_inode(inode)) { | ||
198 | IRELE(ip); | 199 | IRELE(ip); |
199 | return ENOENT; | 200 | goto out_unlock; |
200 | } | 201 | } |
201 | 202 | ||
202 | return 0; | 203 | /* inode is valid */ |
204 | error = 0; | ||
205 | out_unlock: | ||
206 | read_unlock(&pag->pag_ici_lock); | ||
207 | return error; | ||
203 | } | 208 | } |
204 | 209 | ||
205 | STATIC int | 210 | STATIC int |