renameat(2): when retrying, check for pending signals

The vn_start_write() call there is already interruptible.  Check for
user signals before restarting due to ERELOOKUP, or after failed
vn_start_write().  Note that vn_start_write(V_XSLEEP | V_PCATCH)
does not check for signals if not sleeping.

PR:	295826
Reviewed by:	markj
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D57453
This commit is contained in:
Konstantin Belousov
2026-06-04 20:53:26 +03:00
parent 3915ffb1c3
commit 5d0ebfe1d9
+8 -2
View File
@@ -3855,6 +3855,9 @@ kern_renameat(struct thread *td, int oldfd, const char *old, int newfd,
vfs_rel(tmp);
tmp = NULL;
}
error = sig_intr();
if (error != 0)
return (error);
error = vn_start_write(NULL, &mp, V_XSLEEP | V_PCATCH);
if (error != 0)
return (error);
@@ -3937,8 +3940,11 @@ kern_renameat(struct thread *td, int oldfd, const char *old, int newfd,
out1:
if (error == ERESTART)
return (0);
if (error == ERELOOKUP)
goto again;
if (error == ERELOOKUP) {
error = sig_intr();
if (error == 0)
goto again;
}
return (error);
}