[PATCH] ncpfs bug

Michael Tross (mtross@compu-shack.com)
Tue, 25 May 1999 15:07:17 +0200


This is a multi-part message in MIME format.
--------------3043B426A89897CF732115E5
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit

This patch prevents the NCP fs from hanging in a special case and
generating ill network traffic.
I found the case where the linker first opened the output file, wrote
some bytes in the object file header, and then tried to read at a file
offset behind the file size. The NCP function call succeeds with data
length 0, this forces the ncpfs to stay in an endless loop of retrying
to get this data.

I don't know if this patch breaks any other code. And I don't know who
maintaines the ncpfs. But I hope it the patch will be read by someone
who can get it into the next kernels.

My environment: linux kernel 2.2.9 running on a P166, FDDI network
adapter; the NetWare Server is 4.11 with IWSP5B installed.

Michael

-- 
Michael Troß            mtross@compu-shack.de
Systemprogrammierer        Netzwerkspezialist
Compu-Shack Production GmbH, Neuwied, Germany
    http://www.compu-shack.de/production
--------------3043B426A89897CF732115E5
Content-Type: text/plain; charset=us-ascii;
 name="ncp-patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="ncp-patch"

diff -uNr v2.2.9/fs/ncpfs/file.c linux/fs/ncpfs/file.c --- v2.2.9/fs/ncpfs/file.c Mon Aug 24 22:02:44 1998 +++ linux/fs/ncpfs/file.c Tue May 25 14:42:22 1999 @@ -148,6 +148,12 @@ error = -EIO; /* This is not exact, i know.. */ goto out; } + /* NCP return code was success, but no data returned. + Possibly caused by an invalid file offset. */ + if (! read_this_time) { + error = -EFAULT; + goto out; + } pos += read_this_time; buf += read_this_time; already_read += read_this_time;

--------------3043B426A89897CF732115E5--

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/