[PATCH] tmpfs free_inodes leak

From: Hugh Dickins
Date: Mon Nov 15 2004 - 16:40:40 EST


When new_inode failed, shmem_get_inode forgot to restore free_inodes.

Signed-off-by: Hugh Dickins <hugh@xxxxxxxxxxx>

--- 2.6.10-rc2/mm/shmem.c 2004-11-15 16:21:24.000000000 +0000
+++ linux/mm/shmem.c 2004-11-15 19:13:10.535493992 +0000
@@ -1314,6 +1314,10 @@ shmem_get_inode(struct super_block *sb,
case S_IFLNK:
break;
}
+ } else if (sbinfo) {
+ spin_lock(&sbinfo->stat_lock);
+ sbinfo->free_inodes++;
+ spin_unlock(&sbinfo->stat_lock);
}
return inode;
}

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/