git: 1712dc691e0a - stable/15 - kern_filewrite(): unconditionally calculate cnt, it is used by callers
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 20 Jul 2026 20:53:25 UTC
The branch stable/15 has been updated by kib:
URL: https://cgit.FreeBSD.org/src/commit/?id=1712dc691e0a24b578aa263edec9b2c99e26c9dc
commit 1712dc691e0a24b578aa263edec9b2c99e26c9dc
Author: Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2026-07-08 14:54:25 +0000
Commit: Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2026-07-20 20:26:03 +0000
kern_filewrite(): unconditionally calculate cnt, it is used by callers
(cherry picked from commit b72397da275b098365532133688d555b842bad4f)
---
sys/kern/sys_generic.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sys/kern/sys_generic.c b/sys/kern/sys_generic.c
index 07b98613e087..cfc3b6f88c34 100644
--- a/sys/kern/sys_generic.c
+++ b/sys/kern/sys_generic.c
@@ -595,9 +595,9 @@ kern_filewrite(struct thread *td, int fd, struct file *fp, struct uio *auio,
#endif
cnt = auio->uio_resid;
error = fo_write(fp, auio, td->td_ucred, flags, td);
+ cnt -= auio->uio_resid;
#ifdef KTRACE
if (ktruio != NULL) {
- cnt -= auio->uio_resid;
if (error == 0)
ktruio->uio_resid = cnt;
ktrgenio(fd, UIO_WRITE, ktruio, error);