[Pvfs2-developers] read buffer bug

Murali Vilayannur murali.vilayannur at gmail.com
Wed Nov 29 18:37:33 EST 2006


Hi guys,
I am really sorry about this. I am surprised we did not catch this
earlier. This was basically introduced by the file.c/bufmap.c cleanups
that I had done a while back.
Attached patch should fix this error.
thanks for the testcase, Phil!
Murali

On 11/29/06, Phil Carns <pcarns at wastedcycles.org> wrote:
> I ran into a problem today with the 2.6.0 release.  This happened to
> show up in the read04 LTP test, but not reliably.  I have attached a
> test program that I think does trigger it reliably, though.
>
> When run on ext3:
>
>         /home/pcarns> ./testme /tmp/foo.txt
>         read returned: 7, test_buf: hello   world
>
> When run on pvfs2:
>
>         /home/pcarns> ./testme /mnt/pvfs2/foo.txt
>         read returned: 7, test_buf: hello
>
> (or sometimes you might get garbage after the "hello")
>
> The test program creates a string buffer with "goodbye world" stored in
> it.  It then reads the string "hello  " out of a file into the beginning
> of that buffer.   The result should be that the final resulting string
> is "hello  world".
>
> The trick that makes this fail is asking to read more than 7 bytes from
> the file.
>
> In this particular test program, we attempt to do a read of 255 bytes.
> There are only 7 bytes in the file, though.  The return code from read
> accurately reflects this.  However, rather than just fill in the first 7
> bytes of the buffer, it looks like PVFS2 is overwriting the full 255
> bytes.  What ends up in those trailing 248 bytes is somewhat random.
>
> I suspect that somewhere in the kernel module there is a copy_to_user()
> call that is copying the number of bytes requested by the read rather
> than the number of bytes returned by the servers.
>
> -Phil
>
>
> _______________________________________________
> Pvfs2-developers mailing list
> Pvfs2-developers at beowulf-underground.org
> http://www.beowulf-underground.org/mailman/listinfo/pvfs2-developers
>
>
>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: err
Type: application/octet-stream
Size: 3705 bytes
Desc: not available
Url : http://www.beowulf-underground.org/pipermail/pvfs2-developers/attachments/20061129/7901fd0f/err.obj


More information about the Pvfs2-developers mailing list