aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs
diff options
context:
space:
mode:
authorVlad Apostolov <vapo@sgi.com>2007-08-28 00:00:28 -0400
committerTim Shimmin <tes@chook.melbourne.sgi.com>2007-10-15 02:53:36 -0400
commitb93bd20cd59eb7ec172f95d08b100fea688d8bcf (patch)
tree9ce717b59f657e0a7047f099921b28f43faa617f /fs/xfs
parentda353b0d64e070ae7c5342a0d56ec20ae9ef5cfb (diff)
[XFS] do not have XFSMNT_IDELETE as default when mounted with XFSMNT_DMAPI
XFS inodes are dynamically allocated on demand, rather than being allocated at mkfs time. Chunks of 64 inodes are allocated at once, but they are never freed. Over time, this can lead to filesystem fragmentation, clusters of inodes and the btrees which point at them can be scattered around the system. By freeing clusters as they are emptied, we will reduce fragmentation of the free space after removing files. This in turn will allow us to make better placement decisions when repopulating a filesystem. The XFSMNT_IDELETE mount option enables freeing clusters when they get empty. Unfortunately a side effect of freeing inode clusters is that the inode generation numbers of such inodes would be reset to zero when the cluster is reclaimed. This is a problem in particular for a DMAPI enabled filesystem as the the DMAPI handles need to be unique and persistent in time. An unique DMAPI handle is built with the help of the inode generation number. When the last one is prematurely reset by an inode cluster reclaim, there is a high probability of different generation inodes to end up having identical DMAPI handles. To avoid the problem with identical DMAPI handles, the XFSMNT_IDELETE mount option should be set as default, only if the filesystem is not mounted with XFSMNT_DMAPI. SGI-PV: 969192 SGI-Modid: xfs-linux-melb:xfs-kern:29486a Signed-off-by: Vlad Apostolov <vapo@sgi.com> Signed-off-by: David Chinner <dgc@sgi.com> Signed-off-by: Mark Goodwin <markgw@sgi.com> Signed-off-by: Tim Shimmin <tes@sgi.com>
Diffstat (limited to 'fs/xfs')
-rw-r--r--fs/xfs/xfs_vfsops.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/fs/xfs/xfs_vfsops.c b/fs/xfs/xfs_vfsops.c
index 1644be14a144..b4db8a208076 100644
--- a/fs/xfs/xfs_vfsops.c
+++ b/fs/xfs/xfs_vfsops.c
@@ -1720,7 +1720,18 @@ xfs_parseargs(
1720 int dsunit, dswidth, vol_dsunit, vol_dswidth; 1720 int dsunit, dswidth, vol_dsunit, vol_dswidth;
1721 int iosize; 1721 int iosize;
1722 1722
1723 args->flags |= XFSMNT_IDELETE; 1723 /*
1724 * Applications using DMI filesystems often expect the
1725 * inode generation number to be monotonically increasing.
1726 * If we delete inode chunks we break this assumption, so
1727 * keep unused inode chunks on disk for DMI filesystems
1728 * until we come up with a better solution.
1729 * Note that if "ikeep" or "noikeep" mount options are
1730 * supplied, then they are honored.
1731 */
1732 if (!(args->flags & XFSMNT_DMAPI))
1733 args->flags |= XFSMNT_IDELETE;
1734
1724 args->flags |= XFSMNT_BARRIER; 1735 args->flags |= XFSMNT_BARRIER;
1725 args->flags2 |= XFSMNT2_COMPAT_IOSIZE; 1736 args->flags2 |= XFSMNT2_COMPAT_IOSIZE;
1726 1737