lkml.org 
[lkml]   [2005]   [Jul]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[patch] mpol_free_shared_poliy() is not called for non-inline symlink under tmpfs
Hi,

If the inode is non-inline symbolic link under tmpfs,
shmem_destroy_inode() always skips to call mpol_free_shared_policy().
However the policy field of non-inline symbolic link inode is intact and
I think it is better to be freed by mpol_free_shared_policy().
I'm not sure this actually causes any serious problem, but
the following patch fixes it anyway.


diff -Npur linux.org/mm/shmem.c linux/mm/shmem.c
--- linux.org/mm/shmem.c 2005-07-23 04:44:43.000000000 -0400
+++ linux/mm/shmem.c 2005-07-23 04:58:52.000000000 -0400
@@ -2032,8 +2032,8 @@ static struct inode *shmem_alloc_inode(s

static void shmem_destroy_inode(struct inode *inode)
{
- if ((inode->i_mode & S_IFMT) == S_IFREG) {
- /* only struct inode is valid if it's an inline symlink */
+ if ((inode->i_mode & S_IFMT) == S_IFREG ||
+ inode->i_op == &shmem_symlink_inode_operations) {
mpol_free_shared_policy(&SHMEM_I(inode)->policy);
}
kmem_cache_free(shmem_inode_cachep, SHMEM_I(inode));
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2005-07-26 10:48    [W:0.356 / U:0.228 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site