Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 179405
b: refs/heads/master
c: 9850c05
h: refs/heads/master
i:
  179403: d64970c
v: v3
  • Loading branch information
Al Viro committed Jan 14, 2010
1 parent cddb153 commit 644b42c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 806892e9e12e731a0ca76c8f62ad95cf8eea9614
refs/heads/master: 9850c056559f3633a32d810aaf00ced39437b364
20 changes: 9 additions & 11 deletions trunk/fs/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -1604,11 +1604,12 @@ struct file *do_filp_open(int dfd, const char *pathname,
struct file *filp;
struct nameidata nd;
int error;
struct path path, save;
struct path path;
struct dentry *dir;
int count = 0;
int will_truncate;
int flag = open_to_namei_flags(open_flag);
int force_reval = 0;

/*
* O_SYNC is implemented as __O_SYNC|O_DSYNC. As many places only
Expand Down Expand Up @@ -1660,9 +1661,12 @@ struct file *do_filp_open(int dfd, const char *pathname,
/*
* Create - we need to know the parent.
*/
reval:
error = path_init(dfd, pathname, LOOKUP_PARENT, &nd);
if (error)
return ERR_PTR(error);
if (force_reval)
nd.flags |= LOOKUP_REVAL;
error = path_walk(pathname, &nd);
if (error) {
if (nd.root.mnt)
Expand Down Expand Up @@ -1854,17 +1858,7 @@ struct file *do_filp_open(int dfd, const char *pathname,
error = security_inode_follow_link(path.dentry, &nd);
if (error)
goto exit_dput;
save = nd.path;
path_get(&save);
error = __do_follow_link(&path, &nd);
if (error == -ESTALE) {
/* nd.path had been dropped */
nd.path = save;
path_get(&nd.path);
nd.flags |= LOOKUP_REVAL;
error = __do_follow_link(&path, &nd);
}
path_put(&save);
path_put(&path);
if (error) {
/* Does someone understand code flow here? Or it is only
Expand All @@ -1874,6 +1868,10 @@ struct file *do_filp_open(int dfd, const char *pathname,
release_open_intent(&nd);
if (nd.root.mnt)
path_put(&nd.root);
if (error == -ESTALE && !force_reval) {
force_reval = 1;
goto reval;
}
return ERR_PTR(error);
}
nd.flags &= ~LOOKUP_PARENT;
Expand Down

0 comments on commit 644b42c

Please sign in to comment.