From owner-freebsd-bugs Tue Jan 29 7:40:13 2002 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 95D9A37B405 for ; Tue, 29 Jan 2002 07:40:01 -0800 (PST) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id g0TFe1m82661; Tue, 29 Jan 2002 07:40:01 -0800 (PST) (envelope-from gnats) Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id E7AE337B400 for ; Tue, 29 Jan 2002 07:37:50 -0800 (PST) Received: (from nobody@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id g0TFbol82304; Tue, 29 Jan 2002 07:37:50 -0800 (PST) (envelope-from nobody) Message-Id: <200201291537.g0TFbol82304@freefall.freebsd.org> Date: Tue, 29 Jan 2002 07:37:50 -0800 (PST) From: Todd Hayton To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-1.0 Subject: misc/34412: tftp will still try and receive traffic even after receiver's disk has filled Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 34412 >Category: misc >Synopsis: tftp will still try and receive traffic even after receiver's disk has filled >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue Jan 29 07:40:01 PST 2002 >Closed-Date: >Last-Modified: >Originator: Todd Hayton >Release: FreeBSD 2.2 >Organization: Ericsson >Environment: >Description: When copying a large file using tftp, if during the course of the transfer the disk of the receiver fills up, tftp will still try and receive more data from the sender ignoring the fact that the write()'s are failing because there is no more space left. Glancing over the tftp code (/usr/src/usr.bin/tftp) I noticed that the function recvfile() in tftp.c is responsible for the reception of a file. Within this function another function called write_behind() is responsible for writing the received data to disk. Although the write_behind() function returns the return value of the write() system call, this return value is never checked in the calling function recvfile(). The result is that tftp will continue recv'ing and subsequently trying to write() the data despite the fact that each call to write() fails. >How-To-Repeat: Try tftp'ing a large file onto a filesystem that doesn't have enough room to hold it. >Fix: >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message