public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fix mount option pasing to make inode cluster deletion default (again)
@ 2008-02-14  3:34 Eric Sandeen
  2008-02-14  7:45 ` [PATCH 1/1] XFS: replace *_IDELETE with *_IKEEP Josef 'Jeff' Sipek
  2008-02-18 14:38 ` [PATCH] fix mount option pasing to make inode cluster deletion default (again) Eric Sandeen
  0 siblings, 2 replies; 10+ messages in thread
From: Eric Sandeen @ 2008-02-14  3:34 UTC (permalink / raw)
  To: xfs-oss

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@sandeen.net>

---


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) {

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2008-02-20 23:39 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-14  3:34 [PATCH] fix mount option pasing to make inode cluster deletion default (again) Eric Sandeen
2008-02-14  7:45 ` [PATCH 1/1] XFS: replace *_IDELETE with *_IKEEP Josef 'Jeff' Sipek
2008-02-15 16:19   ` Christoph Hellwig
2008-02-15 16:23     ` Eric Sandeen
2008-02-16 13:22       ` Christoph Hellwig
2008-02-17 21:30         ` Josef 'Jeff' Sipek
2008-02-18  5:33           ` Barry Naujok
2008-02-18  6:26             ` Josef 'Jeff' Sipek
2008-02-18 14:38 ` [PATCH] fix mount option pasing to make inode cluster deletion default (again) Eric Sandeen
2008-02-20 23:39   ` Josef 'Jeff' Sipek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox