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 34286d6662
("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>
This commit is contained in:
parent
958e36a73f
commit
bfae7d5cd2
1 changed files with 4 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue