fuse: don't advise readdirplus for negative lookup

If the FUSE_READDIRPLUS_AUTO feature is enabled, then lookups on a
directory before/during readdir are used as an indication that READDIRPLUS
should be used instead of READDIR.  However if the lookup turns out to be
negative, then selecting READDIRPLUS makes no sense.

Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
This commit is contained in:
Miklos Szeredi 2019-10-21 15:57:07 +02:00
parent 2b319d1f6f
commit 6c26f71759

View File

@ -405,7 +405,8 @@ static struct dentry *fuse_lookup(struct inode *dir, struct dentry *entry,
else
fuse_invalidate_entry_cache(entry);
fuse_advise_use_readdirplus(dir);
if (inode)
fuse_advise_use_readdirplus(dir);
return newent;
out_iput: