X-Git-Url: https://bbs.cooldavid.org/git/?p=net-next-2.6.git;a=blobdiff_plain;f=fs%2Fopen.c;h=4197b9ed023d8d1b1831ddf8f706d2a34a934aa6;hp=d74e1983e8dc478145dc8da369c0479bb947d8c2;hb=HEAD;hpb=729963a1ff8d069d05dab6a024bfd59805ac622c diff --git a/fs/open.c b/fs/open.c index d74e1983e8d..4197b9ed023 100644 --- a/fs/open.c +++ b/fs/open.c @@ -786,11 +786,11 @@ struct file *nameidata_to_filp(struct nameidata *nd) /* Pick up the filp from the open intent */ filp = nd->intent.open.file; /* Has the filesystem initialised the file for us? */ - if (filp->f_path.dentry == NULL) + if (filp->f_path.dentry == NULL) { + path_get(&nd->path); filp = __dentry_open(nd->path.dentry, nd->path.mnt, filp, NULL, cred); - else - path_put(&nd->path); + } return filp; }