From: Nobuhiro Tachino <ntachino@us.fujitsu.com>
To: linux-kernel@vger.kernel.org
Subject: [patch] mpol_free_shared_poliy() is not called for non-inline symlink under tmpfs
Date: Tue, 26 Jul 2005 04:44:59 -0400 [thread overview]
Message-ID: <42E5F80B.7060208@us.fujitsu.com> (raw)
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));
reply other threads:[~2005-07-26 8:45 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=42E5F80B.7060208@us.fujitsu.com \
--to=ntachino@us.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox