Menu

#15 vamps premature EOF with kernel 2.6.20

All_Versions
open
nobody
None
5
2007-03-04
2007-03-04
Anonymous
No

All versions of vamps fail under kernel 2.6.20. The problem
is in routine lock() which. The code for reading from the
pipe is not tolerant of the asynchronous stream coming in.

Here is a fix:
#define OLD 0
#if OLD
n = read (0, rhwp, RBUF_SIZE - avail);
#else
{
int nr;
n=0;
do{
nr = read (0, rhwp+n, RBUF_SIZE - avail-n);
n+=nr;
} while(n<RBUF_SIZE-avail && nr>0);
}
#endif

The OLD option is the code that fails. Immediately after the
read statement the program tests to ensure that an integer
number of 2048 sectors has been read. Under kernel 2.6.20 the
buffer is filled in 1024 byte chunks.

The alternative code works, but there are other possible
options for the while.

Discussion


Log in to post a comment.

MongoDB Logo MongoDB