Summary: | bug in sendfile implementation if nbytes != 0 and struct sf_hdtr *hdtr->headers != NULL | ||
---|---|---|---|
Product: | Base System | Reporter: | Vladislav Shabanov <vs> |
Component: | kern | Assignee: | dg |
Status: | Closed FIXED | ||
Severity: | Affects Only Me | ||
Priority: | Normal | ||
Version: | Unspecified | ||
Hardware: | Any | ||
OS: | Any |
Description
Vladislav Shabanov
2002-01-10 20:00:10 UTC
Here is a patch: Index: uipc_syscalls.c =================================================================== RCS file: /home/ncvs/src/sys/kern/uipc_syscalls.c,v retrieving revision 1.65.2.9 diff -u -r1.65.2.9 uipc_syscalls.c --- uipc_syscalls.c 2001/07/31 10:49:39 1.65.2.9 +++ uipc_syscalls.c 2002/01/22 15:01:42 @@ -1532,10 +1532,11 @@ struct vm_page *pg; struct writev_args nuap; struct sf_hdtr hdtr; - off_t off, xfsize, sbytes = 0; + off_t off, xfsize, hdtr_size, sbytes = 0; int error = 0, s; vp = NULL; + hdtr_size = 0; /* * Do argument checking. Must be a regular file in, stream * type and connected socket out, positive offset. @@ -1591,7 +1592,7 @@ error = writev(p, &nuap); if (error) goto done; - sbytes += p->p_retval[0]; + hdtr_size += p->p_retval[0]; } } @@ -1831,11 +1832,12 @@ error = writev(p, &nuap); if (error) goto done; - sbytes += p->p_retval[0]; + hdtr_size += p->p_retval[0]; } done: if (uap->sbytes != NULL) { + sbytes += hdtr_size; copyout(&sbytes, uap->sbytes, sizeof(off_t)); } if (vp) -- Maxim Konovalov, MAcomnet, Internet-Intranet Dept., system engineer phone: +7 (095) 796-9079, mailto: maxim@macomnet.ru Responsible Changed From-To: freebsd-bugs->dg David, this looks closely related to the work you're discussing with Alfred in connection with sendfile(). State Changed From-To: open->closed alfred fixed this bug in rev. 1.103 and rev. 1.65.2.10 src/sys/kern/uipc_syscalls.c in -CURRENT and -STABLE six months ago. |