* [patch 1/2] uml: fix fd leak with HostFs
@ 2004-10-07 18:22 blaisorblade_spam
0 siblings, 0 replies; only message in thread
From: blaisorblade_spam @ 2004-10-07 18:22 UTC (permalink / raw)
To: akpm; +Cc: jdike, linux-kernel, user-mode-linux-devel, blaisorblade_spam
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));
_
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2004-10-08 3:06 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-10-07 18:22 [patch 1/2] uml: fix fd leak with HostFs blaisorblade_spam
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®