vfs_lookup.c: only call ktrcapfail() if KTRACE is enabled

(cherry picked from commit 6b0cf2a237)
This commit is contained in:
Konstantin Belousov 2024-04-24 22:06:14 +03:00
parent 6adfee18ef
commit 00cf2f3092

View file

@ -88,8 +88,14 @@ static void NDVALIDATE_impl(struct nameidata *, int);
ndp->ni_cnd.cn_flags |= ISRESTARTED; \
} while (0)
#ifdef KTRACE
#define NIKTRCAPFAIL(path) ktrcapfail(CAPFAIL_NAMEI, (path))
#else
#define NIKTRCAPFAIL(path)
#endif
#define NI_CAP_VIOLATION(ndp, path) do { \
ktrcapfail(CAPFAIL_NAMEI, (path)); \
NIKTRCAPFAIL(path); \
(ndp)->ni_lcf &= ~NI_LCF_KTR_FLAGS; \
} while (0)