[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1169986611.10987.11.camel@lappy>
Date: Sun, 28 Jan 2007 13:16:51 +0100
From: Peter Zijlstra <a.p.zijlstra@...llo.nl>
To: Andrew Morton <akpm@...l.org>
Cc: linux-kernel@...r.kernel.org, Ingo Molnar <mingo@...e.hu>
Subject: [PATCH 8/7] fs: free_write_pipe() fix
From: Ingo Molnar <mingo@...e.hu>
file_kill() has to look at the file's inode (for the barrier logic),
hence make sure we free the inode before the file.
Signed-off-by: Ingo Molnar <mingo@...e.hu>
---
fs/pipe.c | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
Index: linux/fs/pipe.c
===================================================================
--- linux.orig/fs/pipe.c
+++ linux/fs/pipe.c
@@ -945,12 +945,17 @@ struct file *create_write_pipe(void)
return ERR_PTR(err);
}
-void free_write_pipe(struct file *f)
+void free_write_pipe(struct file *file)
{
- free_pipe_info(f->f_dentry->d_inode);
- dput(f->f_path.dentry);
- mntput(f->f_path.mnt);
- put_filp(f);
+ struct dentry *dentry = file->f_path.dentry;
+ struct vfsmount *mnt = file->f_path.mnt;
+
+ free_pipe_info(file->f_dentry->d_inode);
+ file->f_path.dentry = NULL;
+ file->f_path.mnt = NULL;
+ put_filp(file);
+ dput(dentry);
+ mntput(mnt);
}
struct file *create_read_pipe(struct file *wrf)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists