From: blaisorblade_spam@yahoo.it
To: akpm@osdl.org
Cc: jdike@addtoit.com, linux-kernel@vger.kernel.org,
user-mode-linux-devel@lists.sourceforge.net,
blaisorblade_spam@yahoo.it
Subject: [patch 1/2] uml: fix fd leak with HostFs
Date: Thu, 07 Oct 2004 20:22:54 +0200 [thread overview]
Message-ID: <20041007182254.B3A8A49BA@zion.localdomain> (raw)
On 2.4 we used force_delete() to make sure inode were not cached, and we then
close the host file when the inode is cleared; when porting to 2.6 the
"force_delete" thing was dropped, and this patch adds a fix for this (by
setting drop_inode = generic_delete_inode).
Search for drop_inode in the 2.6 Documentation/filesystems/vfs.txt for info
about this.
Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade_spam@yahoo.it>
---
linux-2.6.9-current-paolo/fs/hostfs/hostfs_kern.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff -puN fs/hostfs/hostfs_kern.c~uml-HostFs-2.6-fd_leak fs/hostfs/hostfs_kern.c
--- linux-2.6.9-current/fs/hostfs/hostfs_kern.c~uml-HostFs-2.6-fd_leak 2004-10-07 17:38:01.075378432 +0200
+++ linux-2.6.9-current-paolo/fs/hostfs/hostfs_kern.c 2004-10-07 20:21:52.868718656 +0200
@@ -290,7 +290,6 @@ static void hostfs_delete_inode(struct i
{
if(HOSTFS_I(inode)->fd != -1) {
close_file(&HOSTFS_I(inode)->fd);
- printk("Closing host fd in .delete_inode\n");
HOSTFS_I(inode)->fd = -1;
}
clear_inode(inode);
@@ -301,9 +300,11 @@ static void hostfs_destroy_inode(struct
if(HOSTFS_I(inode)->host_filename)
kfree(HOSTFS_I(inode)->host_filename);
+ /*XXX: This should not happen, probably. The check is here for
+ * additional safety.*/
if(HOSTFS_I(inode)->fd != -1) {
close_file(&HOSTFS_I(inode)->fd);
- printk("Closing host fd in .destroy_inode\n");
+ printk(KERN_DEBUG "Closing host fd in .destroy_inode\n");
}
kfree(HOSTFS_I(inode));
_
reply other threads:[~2004-10-08 3:06 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=20041007182254.B3A8A49BA@zion.localdomain \
--to=blaisorblade_spam@yahoo.it \
--cc=akpm@osdl.org \
--cc=jdike@addtoit.com \
--cc=linux-kernel@vger.kernel.org \
--cc=user-mode-linux-devel@lists.sourceforge.net \
/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
all inboxes | Powered by JetHome®