cache: only assert on flags when dealing with EMPTYPATH

Reported by:	syzbot+bd48ee0843206a09e6b8@syzkaller.appspotmail.com
Fixes:		7dd419cabc ("cache: add empty path support")

(cherry picked from commit 1045352f15)
This commit is contained in:
Mateusz Guzik 2021-10-17 10:40:16 +02:00
parent 3343c0afbf
commit bac79d8e16

View File

@ -4784,13 +4784,14 @@ cache_fplookup_emptypath(struct cache_fpl *fpl)
tvp_seqc = fpl->tvp_seqc;
MPASS(*cnp->cn_pnbuf == '\0');
MPASS((cnp->cn_flags & (LOCKPARENT | WANTPARENT)) == 0);
if (__predict_false((cnp->cn_flags & EMPTYPATH) == 0)) {
cache_fpl_smr_exit(fpl);
return (cache_fpl_handled_error(fpl, ENOENT));
}
MPASS((cnp->cn_flags & (LOCKPARENT | WANTPARENT)) == 0);
tvs = vget_prep_smr(tvp);
cache_fpl_smr_exit(fpl);
if (__predict_false(tvs == VGET_NONE)) {