diff options
author | Vlad Apostolov <vapo@sgi.com> | 2007-11-23 00:27:51 -0500 |
---|---|---|
committer | Lachlan McIlroy <lachlan@redback.melbourne.sgi.com> | 2008-02-07 02:13:37 -0500 |
commit | c319b58b13bb22f9a2478825b06c641c825f51ec (patch) | |
tree | 92d259656210a8bd698e02aac28b37c32d6a9e3e /fs/xfs/xfs_itable.c | |
parent | 98ce2b5b1bd6db9f8d510b4333757fa6b1efe131 (diff) |
[XFS] Make xfs_bulkstat() to report unlinked but referenced inodes
We need xfs_bulkstat() to report inode stat for inodes with link count
zero but reference count non zero.
The fix here:
http://oss.sgi.com/archives/xfs/2007-09/msg00266.html
changed this behavior and made xfs_bulkstat() to filter all unlinked
inodes including those that are not destroyed yet but held by reference.
The attached patch returns back to the original behavior by marking the
on-disk inode buffer "dirty" when di_mode is cleared (at that time both
inode link and reference counter are zero).
SGI-PV: 972004
SGI-Modid: xfs-linux-melb:xfs-kern:29914a
Signed-off-by: Vlad Apostolov <vapo@sgi.com>
Signed-off-by: David Chinner <dgc@sgi.com>
Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_itable.c')
-rw-r--r-- | fs/xfs/xfs_itable.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/xfs/xfs_itable.c b/fs/xfs/xfs_itable.c index 9fc4c2886529..d9ca3c0eb8cc 100644 --- a/fs/xfs/xfs_itable.c +++ b/fs/xfs/xfs_itable.c | |||
@@ -291,7 +291,7 @@ xfs_bulkstat_use_dinode( | |||
291 | dip = (xfs_dinode_t *) | 291 | dip = (xfs_dinode_t *) |
292 | xfs_buf_offset(bp, clustidx << mp->m_sb.sb_inodelog); | 292 | xfs_buf_offset(bp, clustidx << mp->m_sb.sb_inodelog); |
293 | /* | 293 | /* |
294 | * Check the buffer containing the on-disk inode for di_nlink == 0. | 294 | * Check the buffer containing the on-disk inode for di_mode == 0. |
295 | * This is to prevent xfs_bulkstat from picking up just reclaimed | 295 | * This is to prevent xfs_bulkstat from picking up just reclaimed |
296 | * inodes that have their in-core state initialized but not flushed | 296 | * inodes that have their in-core state initialized but not flushed |
297 | * to disk yet. This is a temporary hack that would require a proper | 297 | * to disk yet. This is a temporary hack that would require a proper |
@@ -299,7 +299,7 @@ xfs_bulkstat_use_dinode( | |||
299 | */ | 299 | */ |
300 | if (be16_to_cpu(dip->di_core.di_magic) != XFS_DINODE_MAGIC || | 300 | if (be16_to_cpu(dip->di_core.di_magic) != XFS_DINODE_MAGIC || |
301 | !XFS_DINODE_GOOD_VERSION(dip->di_core.di_version) || | 301 | !XFS_DINODE_GOOD_VERSION(dip->di_core.di_version) || |
302 | !dip->di_core.di_nlink) | 302 | !dip->di_core.di_mode) |
303 | return 0; | 303 | return 0; |
304 | if (flags & BULKSTAT_FG_QUICK) { | 304 | if (flags & BULKSTAT_FG_QUICK) { |
305 | *dipp = dip; | 305 | *dipp = dip; |