diff options
| author | Jaegeuk Kim <jaegeuk@kernel.org> | 2017-01-26 11:50:00 +0200 |
|---|---|---|
| committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2017-01-28 23:23:03 -0800 |
| commit | bfae7d5cd2bef44fcc95f34c72d6843f91fa49c9 (patch) | |
| tree | c4d7497680d54d53b3e19f66c3f33dad28f17023 | |
| parent | 958e36a73f7fe46ee28a749cd9b56ddf5dbf56cd (diff) | |
ext4/fscrypto: avoid RCU lookup in d_revalidate
As Al pointed, d_revalidate should return RCU lookup before using d_inode.
This was originally introduced by:
commit 34286d666230 ("fs: rcu-walk aware d_revalidate method").
Change-Id: I81999f7b4651d7dd64695c94d15561dfdcec851b
Reported-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Cc: Theodore Ts'o <tytso@mit.edu>
Cc: stable <stable@vger.kernel.org>
Git-commit: 03a8bb0e53d9562276045bdfcf2b5de2e4cff5a1
Git-repo: git://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git
[andreym@codeaurora.org: resolve merge conflicts,
fs/crypto/crypto.c does not exist in current branch,
had to omit it]
Signed-off-by: Andrey Markovytch <andreym@codeaurora.org>
| -rw-r--r-- | fs/ext4/crypto.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/ext4/crypto.c b/fs/ext4/crypto.c index 1bb67391225a..664f42c850b7 100644 --- a/fs/ext4/crypto.c +++ b/fs/ext4/crypto.c @@ -34,6 +34,7 @@ #include <linux/random.h> #include <linux/scatterlist.h> #include <linux/spinlock_types.h> +#include <linux/namei.h> #include "ext4_extents.h" #include "xattr.h" @@ -487,6 +488,9 @@ static int ext4_d_revalidate(struct dentry *dentry, unsigned int flags) struct ext4_crypt_info *ci; int dir_has_key, cached_with_key; + if (flags & LOOKUP_RCU) + return -ECHILD; + dir = dget_parent(dentry); if (!ext4_encrypted_inode(d_inode(dir))) { dput(dir); |
