lkml.org 
[lkml]   [1999]   [May]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] ncpfs bug
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/productiondiff -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;
\
 
 \ /
  Last update: 2005-03-22 13:51    [W:0.027 / U:0.280 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site