xfs
[Top] [All Lists]

[PATCH] fix mount option pasing to make inode cluster deletion default (

To: xfs-oss <xfs@xxxxxxxxxxx>
Subject: [PATCH] fix mount option pasing to make inode cluster deletion default (again)
From: Eric Sandeen <sandeen@xxxxxxxxxxx>
Date: Wed, 13 Feb 2008 21:34:06 -0600
Sender: xfs-bounce@xxxxxxxxxxx
User-agent: Thunderbird 2.0.0.9 (Macintosh/20071031)
mod xfs-linux-melb:xfs-kern:29683a / 
git commit 574342f4ad450b33bc85ec53210b8aa8bfff2fcf

broke default options in such a way that empty inode clusters 
are no longer deleted by default, because if no options are 
given, we "goto done;" without setting the default 
XFSMNT_IDELETE flag.

All this logic could probably be rearranged to make things
clearer, but for now I think this small patch fixes it:

Set IDELETE a.k.a. "noikeep" by default, but if dmapi is in
use, turn it back off (i.e. "ikeep") *unless* noikeep was 
specifically requested.

Signed-off-by: Eric Sandeen <sandeen@xxxxxxxxxxx>

---


Index: linux-2.6.24/fs/xfs/linux-2.6/xfs_super.c
===================================================================
--- linux-2.6.24.orig/fs/xfs/linux-2.6/xfs_super.c
+++ linux-2.6.24/fs/xfs/linux-2.6/xfs_super.c
@@ -171,9 +171,10 @@ xfs_parseargs(
        char                    *this_char, *value, *eov;
        int                     dsunit, dswidth, vol_dsunit, vol_dswidth;
        int                     iosize;
-       int                     ikeep = 0;
+       int                     noikeep = 0; /* track _explicit_ requests */
 
        args->flags |= XFSMNT_BARRIER;
+       args->flags |= XFSMNT_IDELETE;  /* i.e. "noikeep" is default */
        args->flags2 |= XFSMNT2_COMPAT_IOSIZE;
 
        if (!options)
@@ -302,9 +303,9 @@ xfs_parseargs(
                } else if (!strcmp(this_char, MNTOPT_NOBARRIER)) {
                        args->flags &= ~XFSMNT_BARRIER;
                } else if (!strcmp(this_char, MNTOPT_IKEEP)) {
-                       ikeep = 1;
                        args->flags &= ~XFSMNT_IDELETE;
                } else if (!strcmp(this_char, MNTOPT_NOIKEEP)) {
+                       noikeep = 1; /* explicitly requested */
                        args->flags |= XFSMNT_IDELETE;
                } else if (!strcmp(this_char, MNTOPT_LARGEIO)) {
                        args->flags2 &= ~XFSMNT2_COMPAT_IOSIZE;
@@ -410,8 +411,8 @@ xfs_parseargs(
         * Note that if "ikeep" or "noikeep" mount options are
         * supplied, then they are honored.
         */
-       if (!(args->flags & XFSMNT_DMAPI) && !ikeep)
-               args->flags |= XFSMNT_IDELETE;
+       if ((args->flags & XFSMNT_DMAPI) && !noikeep)
+               args->flags &= ~XFSMNT_IDELETE;
 
        if ((args->flags & XFSMNT_NOALIGN) != XFSMNT_NOALIGN) {
                if (dsunit) {


<Prev in Thread] Current Thread [Next in Thread>