From f645dffc905d3b88498d4d0b1755204f642ba0ca Mon Sep 17 00:00:00 2001 From: Miklos Szeredi Date: Mon, 21 May 2012 17:30:18 +0200 Subject: [PATCH] --- yaml --- r: 310067 b: refs/heads/master c: 50ee93afcaa970620d1fb5a9894109a2ab152868 h: refs/heads/master i: 310065: 9879b8472635df547295e5019abbb422108b8925 310063: 25f741023997fdd87e123e2ee91f399ce77a8856 v: v3 --- [refs] | 2 +- trunk/fs/open.c | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index 85eb7638b3ac..17371a7c22e2 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 91daee988db38b0207eec719a3160b163c077007 +refs/heads/master: 50ee93afcaa970620d1fb5a9894109a2ab152868 diff --git a/trunk/fs/open.c b/trunk/fs/open.c index 9fd34b76b959..d6c79a0dffc7 100644 --- a/trunk/fs/open.c +++ b/trunk/fs/open.c @@ -824,10 +824,11 @@ struct file *nameidata_to_filp(struct nameidata *nd) /* Pick up the filp from the open intent */ filp = nd->intent.open.file; - nd->intent.open.file = NULL; /* Has the filesystem initialised the file for us? */ - if (filp->f_path.dentry == NULL) { + if (filp->f_path.dentry != NULL) { + nd->intent.open.file = NULL; + } else { struct file *res; path_get(&nd->path); @@ -836,6 +837,7 @@ struct file *nameidata_to_filp(struct nameidata *nd) if (!IS_ERR(res)) { int error; + nd->intent.open.file = NULL; BUG_ON(res != filp); error = open_check_o_direct(filp); @@ -844,7 +846,7 @@ struct file *nameidata_to_filp(struct nameidata *nd) filp = ERR_PTR(error); } } else { - put_filp(filp); + /* Allow nd->intent.open.file to be recycled */ filp = res; } }