summaryrefslogtreecommitdiffstats
path: root/fs/dcache.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2016-03-09 17:58:49 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2016-03-14 00:17:28 -0400
commit27f203f655a2e1dab66598a5b19afb637c587f0b (patch)
treea022bd5f91af856da9cd9e31329850bcc0163873 /fs/dcache.c
parent34d0d19dc0929ccc326448737f05a8fae3d47b8a (diff)
downloadlinux-stable-27f203f655a2e1dab66598a5b19afb637c587f0b.tar.gz
linux-stable-27f203f655a2e1dab66598a5b19afb637c587f0b.tar.bz2
linux-stable-27f203f655a2e1dab66598a5b19afb637c587f0b.zip
untangle fsnotify_d_instantiate() a bit
First of all, don't bother calling it if inode is NULL - that makes inode argument unused. Moreover, do it *before* dropping ->d_lock, not right after that (and don't bother grabbing ->d_lock in it, of course). Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/dcache.c')
-rw-r--r--fs/dcache.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/dcache.c b/fs/dcache.c
index 12280df07837..244fd2487fe9 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -1750,8 +1750,9 @@ static void __d_instantiate(struct dentry *dentry, struct inode *inode)
raw_write_seqcount_begin(&dentry->d_seq);
__d_set_inode_and_type(dentry, inode, add_flags);
raw_write_seqcount_end(&dentry->d_seq);
+ if (inode)
+ __fsnotify_d_instantiate(dentry);
spin_unlock(&dentry->d_lock);
- fsnotify_d_instantiate(dentry, inode);
}
/**