From: Christoph Hellwig > You have hugetlbfs_inc_free_inodes() doing sbinfo->free_inodes--; > > So I think the names of those two functions need to be swapped over. Ok, should be fine with this trivial patch: Signed-off-by: Christoph Hellwig Signed-off-by: Andrew Morton --- fs/hugetlbfs/inode.c | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) diff -puN fs/hugetlbfs/inode.c~hugetlbfs-move-free_inodes-accounting-fix fs/hugetlbfs/inode.c --- devel/fs/hugetlbfs/inode.c~hugetlbfs-move-free_inodes-accounting-fix 2005-09-24 18:40:42.000000000 -0700 +++ devel-akpm/fs/hugetlbfs/inode.c 2005-09-24 18:40:42.000000000 -0700 @@ -505,7 +505,7 @@ static void hugetlbfs_put_super(struct s } } -static inline int hugetlbfs_inc_free_inodes(struct hugetlbfs_sb_info *sbinfo) +static inline int hugetlbfs_dec_free_inodes(struct hugetlbfs_sb_info *sbinfo) { if (sbinfo->free_inodes >= 0) { spin_lock(&sbinfo->stat_lock); @@ -520,7 +520,7 @@ static inline int hugetlbfs_inc_free_ino return 1; } -static void hugetlbfs_dec_free_inodes(struct hugetlbfs_sb_info *sbinfo) +static void hugetlbfs_inc_free_inodes(struct hugetlbfs_sb_info *sbinfo) { if (sbinfo->free_inodes >= 0) { spin_lock(&sbinfo->stat_lock); @@ -537,11 +537,11 @@ static struct inode *hugetlbfs_alloc_ino struct hugetlbfs_sb_info *sbinfo = HUGETLBFS_SB(sb); struct hugetlbfs_inode_info *p; - if (unlikely(!hugetlbfs_inc_free_inodes(sbinfo))) + if (unlikely(!hugetlbfs_dec_free_inodes(sbinfo))) return NULL; p = kmem_cache_alloc(hugetlbfs_inode_cachep, SLAB_KERNEL); if (unlikely(!p)) { - hugetlbfs_dec_free_inodes(sbinfo); + hugetlbfs_inc_free_inodes(sbinfo); return NULL; } return &p->vfs_inode; @@ -549,7 +549,7 @@ static struct inode *hugetlbfs_alloc_ino static void hugetlbfs_destroy_inode(struct inode *inode) { - hugetlbfs_dec_free_inodes(HUGETLBFS_SB(inode->i_sb)); + hugetlbfs_inc_free_inodes(HUGETLBFS_SB(inode->i_sb)); mpol_free_shared_policy(&HUGETLBFS_I(inode)->policy); kmem_cache_free(hugetlbfs_inode_cachep, HUGETLBFS_I(inode)); } _