Message ID | 1380535881-9239-36-git-send-email-luis.henriques@canonical.com |
---|---|
State | New |
Headers | show |
diff --git a/fs/cifs/readdir.c b/fs/cifs/readdir.c index 6cb83b9..8ae4457 100644 --- a/fs/cifs/readdir.c +++ b/fs/cifs/readdir.c @@ -107,6 +107,14 @@ cifs_readdir_lookup(struct dentry *parent, struct qstr *name, dput(dentry); } + /* + * If we know that the inode will need to be revalidated immediately, + * then don't create a new dentry for it. We'll end up doing an on + * the wire call either way and this spares us an invalidation. + */ + if (fattr->cf_flags & CIFS_FATTR_NEED_REVAL) + return NULL; + dentry = d_alloc(parent, name); if (dentry == NULL) return NULL;