[Sheepdog] [PATCH 2/2] make vdi setattr atomic

Chris Webb chris at arachsys.com
Mon Oct 17 18:42:27 CEST 2011


MORITA Kazutaka <morita.kazutaka at lab.ntt.co.jp> writes:

> Sorry, I have no idea why your sheep daemons return EIO errors.  I
> thought that the reason was the offset (or length) was not aligned,
> but it looks wrong.
> 
> I've sent a patch to show an error reason when the sheep daemon
> returns SD_RES_EIO.  Can you pull the vdiattr branch and try again?

Hi Kazutaka. I pulled the vdiattr branch, did a make clean && make, and then
retested using that.

The first 4MB chunk uploaded successfully, and then the second caused collie
to segfault:

[4707] collie vdi write d5e2e937-2a25-415b-b9e0-ec931ff64c43 8388608
4728 Segmentation fault (core dumped) collie vdi write d5e2e937-2a25-415b-b9e0-ec931ff64c43 8388608
Exit code: 139

This is

(gdb) bt
#0  0x00007f95f654ed38 in memset () from /lib/libc.so.6
#1  0x000000000040536d in vdi_write (argc=<value optimized out>, argv=<value optimized out>) at vdi.c:1141
#2  0x0000000000402543 in main (argc=5, argv=0x7fff4194d2c8) at collie.c:343

which is

            /* exit after this buffer is sent */
            memset(buf + (len - remain), 0, remain);

I can reproduce this fairly reliably with

0026# dd if=/dev/zero bs=1k count=4096 | collie vdi write d5e2e937-2a25-415b-b9e0-ec931ff64c43 8388608
4096+0 records in
4096+0 records out
4194304 bytes (4.2 MB) copied, 0.211225 s, 19.9 MB/s
Segmentation fault (core dumped)

Cheers,

Chris.



More information about the sheepdog mailing list