->delete_inode() is only called when the inode is being deleted.  So we're
leaving inodes on the reservation list when they are reclaimed by the VM.

So take them off the reservation list in ->clear_inode instead.


---

 25-akpm/fs/ext3/inode.c |    3 ---
 25-akpm/fs/ext3/super.c |    9 +++------
 2 files changed, 3 insertions(+), 9 deletions(-)

diff -puN fs/ext3/super.c~ext3-discard-reservation-in-last-iput-fix-patch-fix fs/ext3/super.c
--- 25/fs/ext3/super.c~ext3-discard-reservation-in-last-iput-fix-patch-fix	2004-04-24 00:41:34.480017152 -0700
+++ 25-akpm/fs/ext3/super.c	2004-04-24 00:42:14.141987616 -0700
@@ -493,10 +493,9 @@ static void destroy_inodecache(void)
 		printk(KERN_INFO "ext3_inode_cache: not all structures were freed\n");
 }
 
-#ifdef CONFIG_EXT3_FS_POSIX_ACL
-
 static void ext3_clear_inode(struct inode *inode)
 {
+#ifdef CONFIG_EXT3_FS_POSIX_ACL
        if (EXT3_I(inode)->i_acl &&
            EXT3_I(inode)->i_acl != EXT3_ACL_NOT_CACHED) {
                posix_acl_release(EXT3_I(inode)->i_acl);
@@ -507,11 +506,9 @@ static void ext3_clear_inode(struct inod
                posix_acl_release(EXT3_I(inode)->i_default_acl);
                EXT3_I(inode)->i_default_acl = EXT3_ACL_NOT_CACHED;
        }
-}
-
-#else
-# define ext3_clear_inode NULL
 #endif
+	ext3_discard_reservation(inode);
+}
 
 #ifdef CONFIG_QUOTA
 
diff -puN fs/ext3/inode.c~ext3-discard-reservation-in-last-iput-fix-patch-fix fs/ext3/inode.c
--- 25/fs/ext3/inode.c~ext3-discard-reservation-in-last-iput-fix-patch-fix	2004-04-24 00:41:34.497014568 -0700
+++ 25-akpm/fs/ext3/inode.c	2004-04-24 00:42:31.418361208 -0700
@@ -186,9 +186,6 @@ void ext3_delete_inode (struct inode * i
 	if (is_bad_inode(inode))
 		goto no_delete;
 
-	/* discard the block reservation */
-	ext3_discard_reservation(inode);
-
 	handle = start_transaction(inode);
 	if (IS_ERR(handle)) {
 		/* If we're going to skip the normal cleanup, we still

_