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

MORITA Kazutaka morita.kazutaka at lab.ntt.co.jp
Tue Oct 18 01:24:57 CEST 2011


At Mon, 17 Oct 2011 17:42:27 +0100,
Chris Webb wrote:
> 
> 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)

Thanks for your testing!  There was a trivial bug in collie/vdi.c.
I've sent a patch and pushed it to vdiattr branch.  It may solve all
of your problems.

Thanks,

Kazutaka



More information about the sheepdog mailing list