| Summary: | 2872-or-less-byte ftp binary transfer from smbfs share produces garbage | ||
|---|---|---|---|
| Product: | Base System | Reporter: | Doug Lee <dgl> |
| Component: | bin | Assignee: | freebsd-bugs (Nobody) <bugs> |
| Status: | Closed FIXED | ||
| Severity: | Affects Only Me | ||
| Priority: | Normal | ||
| Version: | 4.3-STABLE | ||
| Hardware: | Any | ||
| OS: | Any | ||
|
Description
Doug Lee
2001-11-01 15:50:00 UTC
State Changed
From-To: open->feedback
First, try a recent RELENG_4 and confirm that the problem persists.
Then, my guess would be sendfile() ickiness. We can prove this by
forcing the use of the old method instead of sendfile().
In ftpd.c, in send_data(), find the first occurrence of
if (isreg) {
and insert
goto oldway;
immediately before it. This will skip the sendfile() method. If that
solves the problem, we know it's odd sendfile() interaction with
smbfs (or possibly all remote filesystem types). If so, it'd
be interesting to see whether the same behaviour is observed with
NFS instead of smbfs.
Followup confirming that the problem is sendfile(2)-specific. Ciao, Sheldon. ----- Original Message ----- Date: Sun, 30 Dec 2001 15:47:45 +0100 (CET) From: Michal Mertl <mime@traveller.cz> To: Sheldon Hearn <sheldonh@starjuice.net> cc: current@freebsd.org Subject: Re: ntfs and sendfile problem (corrupted data) > On Sun, 30 Dec 2001, Sheldon Hearn wrote: > > > > > > > On Sun, 30 Dec 2001 01:53:08 +0100, Michal Mertl wrote: > > > > > I have ntfs partition mounted ro on current. I can read from it without > > > problems. But I noticed I get corrupted data (the corrupted file has > > > right size but contains mostly zeros) when using ftpd to read them. > > > > > > I'm pretty sure the problem is thus in sendfile(2) and/or ntfs fs support. > > > > See also PR bin/31692, which reports simmilar problems using ftpd and > > smbfs. See my request for feedback, which ought to help verify that > > it's sendfile(2) causing the problem. > > > > I did use the "goto oldway;" and the problem went away. I tried to look at > /sys/kern/uipc_syscalls.c sendfile implementation but it is too complex > for me :-(. I tried ktrace on ftpd but only saw the call to sendfile(2). > If you give me some guidance I can try to look into problem deeper. I > don't have any experience in kernel debugging but would like to learn it. > > > > > Ciao, > > Sheldon. > > > > -- > Michal Mertl > mime@traveller.cz > State Changed From-To: feedback->open Feedback has been requested and received; throw this PR back open. State Changed From-To: open->closed Same as kern/36038; closing this one as a duplicate because the newer PR has a more useful audit trail |