From: Miklos Szeredi Date: Mon, 21 Oct 2019 13:57:07 +0000 (+0200) Subject: fuse: don't advise readdirplus for negative lookup X-Git-Tag: v5.4-rc6~25^2~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6c26f71759a6efc04b888dd2c1cc4f1cac38cdf0;p=thirdparty%2Fkernel%2Flinux.git 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 --- diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c index d572c900bb0f2..b77954a275384 100644 --- a/fs/fuse/dir.c +++ b/fs/fuse/dir.c @@ -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: