nfs: add missing rcu-walk check
authorNick Piggin <npiggin@kernel.dk>
Fri, 14 Jan 2011 02:48:39 +0000 (02:48 +0000)
committerNick Piggin <npiggin@kernel.dk>
Fri, 14 Jan 2011 02:48:39 +0000 (02:48 +0000)
Signed-off-by: Nick Piggin <npiggin@kernel.dk>
fs/nfs/dir.c

index d33da530097acd350493bcbab2f315311f474b30..a0d8320bed9cbc34213c0655d5b476c9c116f2ac 100644 (file)
@@ -1410,11 +1410,15 @@ no_open:
 static int nfs_open_revalidate(struct dentry *dentry, struct nameidata *nd)
 {
        struct dentry *parent = NULL;
-       struct inode *inode = dentry->d_inode;
+       struct inode *inode;
        struct inode *dir;
        struct nfs_open_context *ctx;
        int openflags, ret = 0;
 
+       if (nd->flags & LOOKUP_RCU)
+               return -ECHILD;
+
+       inode = dentry->d_inode;
        if (!is_atomic_open(nd) || d_mountpoint(dentry))
                goto no_open;