Skip to content

Commit

Permalink
untangling do_lookup() - isolate !dentry stuff from the rest of it.
Browse files Browse the repository at this point in the history
Duplicate the revalidation-related parts into if (!dentry) branch.
Next step will be to pull them under i_mutex.

This and the next 8 commits are more or less a splitup of patch
by Miklos; folks, when you are working with something that convoluted,
carve your patches up into easily reviewed steps, especially when
a lot of codepaths involved are rarely hit...

Signed-off-by: Al Viro <[email protected]>
  • Loading branch information
Al Viro committed Mar 31, 2012
1 parent cda309d commit 3f6c7c7
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion fs/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -1194,6 +1194,21 @@ static int do_lookup(struct nameidata *nd, struct qstr *name,
status = 1;
}
mutex_unlock(&dir->i_mutex);
if (unlikely(dentry->d_flags & DCACHE_OP_REVALIDATE) && need_reval)
status = d_revalidate(dentry, nd);
if (unlikely(status <= 0)) {
if (status < 0) {
dput(dentry);
return status;
}
if (!d_invalidate(dentry)) {
dput(dentry);
dentry = NULL;
need_reval = 1;
goto retry;
}
}
goto done;
}
if (unlikely(dentry->d_flags & DCACHE_OP_REVALIDATE) && need_reval)
status = d_revalidate(dentry, nd);
Expand All @@ -1209,7 +1224,7 @@ static int do_lookup(struct nameidata *nd, struct qstr *name,
goto retry;
}
}

done:
path->mnt = mnt;
path->dentry = dentry;
err = follow_managed(path, nd->flags);
Expand Down

0 comments on commit 3f6c7c7

Please sign in to comment.