aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/subr_syscall.c
diff options
context:
space:
mode:
authorKonstantin Belousov <kib@FreeBSD.org>2020-11-13 09:42:32 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2020-11-13 09:42:32 +0000
commit441eb16a953ac93d356e0cda28b45cb66ad70bcc (patch)
tree4bc0bfc1ebefb9729a636334f5745ba23eb9c2e3 /sys/kern/subr_syscall.c
parent7cde2ec4fdb20cac4f1f1fff1a8604028b36b42c (diff)
downloadsrc-441eb16a953ac93d356e0cda28b45cb66ad70bcc.tar.gz
src-441eb16a953ac93d356e0cda28b45cb66ad70bcc.zip
Allow some VOPs to return ERELOOKUP to indicate VFS operation restart at top level.
Restart syscalls and some sync operations when filesystem indicated ERELOOKUP condition, mostly for VOPs operating on metdata. In particular, lookup results cached in the inode/v_data is no longer valid and needs recalculating. Right now this should be nop. Assert that ERELOOKUP is catched everywhere and not returned to userspace, by asserting that td_errno != ERELOOKUP on syscall return path. In collaboration with: pho Reviewed by: mckusick (previous version), markj Tested by: markj (syzkaller), pho Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D26136
Notes
Notes: svn path=/head/; revision=367632
Diffstat (limited to 'sys/kern/subr_syscall.c')
-rw-r--r--sys/kern/subr_syscall.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/kern/subr_syscall.c b/sys/kern/subr_syscall.c
index a37f3dba3d34..85a0814a2125 100644
--- a/sys/kern/subr_syscall.c
+++ b/sys/kern/subr_syscall.c
@@ -217,6 +217,8 @@ syscallret(struct thread *td)
KASSERT((td->td_pflags & TDP_FORKING) == 0,
("fork() did not clear TDP_FORKING upon completion"));
+ KASSERT(td->td_errno != ERELOOKUP,
+ ("ERELOOKUP not consumed syscall %d", td->td_sa.code));
p = td->td_proc;
sa = &td->td_sa;