[Devel] [PATCH] tmpfs free_inodes leak

Mishin Dmitry dim at sw.ru
Tue Dec 6 07:00:57 PST 2005


Patch from mainstream:

[PATCH] tmpfs free_inodes leak

When new_inode failed, shmem_get_inode forgot to restore free_inodes.

Signed-off-by: Hugh Dickins <hugh at veritas.com>
Signed-off-by: Andrew Morton <akpm at osdl.org>
Signed-off-by: Linus Torvalds <torvalds at osdl.org>

-- 
Thanks,
Dmitry.
-------------- next part --------------
diff -Naru a/mm/shmem.c b/mm/shmem.c
--- a/mm/shmem.c	2005-12-06 06:49:37 -08:00
+++ b/mm/shmem.c	2005-12-06 06:49:37 -08:00
@@ -1314,6 +1314,10 @@
 		case S_IFLNK:
 			break;
 		}
+	} else if (sbinfo) {
+		spin_lock(&sbinfo->stat_lock);
+		sbinfo->free_inodes++;
+		spin_unlock(&sbinfo->stat_lock);
 	}
 	return inode;
 }
# This is a BitKeeper generated diff -Nru style patch.
#
# ChangeSet
#   2004/11/15 19:54:18-08:00 hugh at veritas.com 
#   [PATCH] tmpfs free_inodes leak
#   
#   When new_inode failed, shmem_get_inode forgot to restore free_inodes.
#   
#   Signed-off-by: Hugh Dickins <hugh at veritas.com>
#   Signed-off-by: Andrew Morton <akpm at osdl.org>
#   Signed-off-by: Linus Torvalds <torvalds at osdl.org>
# 
# mm/shmem.c
#   2004/11/15 19:29:07-08:00 hugh at veritas.com +4 -0
#   tmpfs free_inodes leak
# 


More information about the Devel mailing list