Your message dated Sun, 20 Dec 2015 10:43:32 +0000
with message-id <[email protected]>
and subject line Bug#703052: fixed in nbd 1:3.12.1-1
has caused the Debian Bug report #703052,
regarding nbd-client: fails on partial reads
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
703052: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=703052
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: nbd-client
Version: 1:3.2-2
Severity: normal

after strating nbd-client, ioctl NBD_DO_IT randomly returned EPROTO, or
our cutom server exited because of an EOF condition.

the reason are bugs in nbd-client:

        if (read(sock, buf, 8) < 0)
        if (read(sock, &magic, sizeof(magic)) < 0)
        if (read(sock, &size64, sizeof(size64)) < 0)
        if (read(sock, flags, sizeof(*flags)) < 0)
        if (read(sock, &buf, 124) < 0)

all these reads in negotiate() would work with files, but not with
sockets, as sockets can (and do) legally return "whats there" and do not
wait for more data to arrive on partial reads.

in our case, due to slow network writes, one of these actually read less
data, most commonly the last one:

   [pid 13113] read(5, 
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 124) = 
108

since nbd-client does not properly read all the data, the remaining 16
bytes will errornously be read by the kernel, which then reacts correctly
with EPROTO.

the fix would be to replace all these read's with a function that properly
retries if less data was read, until either eof or an error is hit, or all
data has been read.

interestingly enough, the nbd-server contains a function "readit" for just
that reason, so the code is already there.

-- System Information:
Debian Release: 7.0
  APT prefers stable
  APT policy: (990, 'stable'), (500, 'unstable'), (500, 'testing'), (1, 
'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.2.0-4-amd64 (SMP w/4 CPU cores)
Locale: LANG=C, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages nbd-client depends on:
ii  debconf [debconf-2.0]  1.5.49
ii  initscripts            2.88dsf-41
ii  libc6                  2.13-38

nbd-client recommends no packages.

nbd-client suggests no packages.

-- debconf information excluded

--- End Message ---
--- Begin Message ---
Source: nbd
Source-Version: 1:3.12.1-1

We believe that the bug you reported is fixed in the latest version of
nbd, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Wouter Verhelst <[email protected]> (supplier of updated nbd package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.8
Date: Wed, 11 Nov 2015 11:04:37 +0100
Source: nbd
Binary: nbd-server nbd-client nbd-client-udeb
Architecture: source amd64
Version: 1:3.12.1-1
Distribution: unstable
Urgency: medium
Maintainer: Wouter Verhelst <[email protected]>
Changed-By: Wouter Verhelst <[email protected]>
Description:
 nbd-client - Network Block Device protocol - client
 nbd-client-udeb - Network Block Device protocol - client for Debian Installer 
(udeb)
 nbd-server - Network Block Device protocol - server
Closes: 703052 801883 801911 802201 803224 803308 803795
Changes:
 nbd (1:3.12.1-1) unstable; urgency=medium
 .
   * New upstream release
     - Fixes listening on IPv6; Closes: #803795.
     - Fixes unrepeated use of read() system call; Closes: #703052.
   * Merge never-released branch targeted at experimental, which dealt
     with the fact that the oldstyle handshake protocol is no longer
     supported in nbd upstream.
   * Update debconf translation changes introduced in 1:3.10-1~1:
     - Dutch, by yours truly
     - Portuguese, by Américo Monteiro; Closes: #801911
     - Russian, by Yuri Kuzlov; Closes: #801883
     - Danish, by Joe Dalton.
     - German, by Chris Leick; Closes: #802201
     - Czech, by Miroslav Kure; Closes: #803224
     - Spanish, by Camaleón; Closes: #803308
Checksums-Sha1:
 d4cb9bab73a7a0db44f4069902ae3e52cac59a2f 1934 nbd_3.12.1-1.dsc
 7946abfb4a02e8b53f13e7cd6fb236d4f4662593 968960 nbd_3.12.1.orig.tar.gz
 6cc6e9735df0b753b22b7a45d7fd4a0b2b3766ae 101179 nbd_3.12.1-1.diff.gz
 ea34972c6bfaea9784b9d6a1cf0969b21703003a 9654 
nbd-client-udeb_3.12.1-1_amd64.udeb
 1a7ed43025df7d3a3886602a10b9ee203cc7dc69 65226 nbd-client_3.12.1-1_amd64.deb
 d7089bc250eec82623e8600f2b7e0126ec8dd3d5 72746 nbd-server_3.12.1-1_amd64.deb
Checksums-Sha256:
 100f9f2ae880dc21104b33ecf32c7e1d34d4b1dfdca3138aabac0ac054847204 1934 
nbd_3.12.1-1.dsc
 ad3c513b4579ee02fcc0a34db28f0eeeaf474f35bb23547b3c268464a2819327 968960 
nbd_3.12.1.orig.tar.gz
 cf197d688130d491b3f46af33f3a1771a320c26fc4b4d49c9b1654cdf7d8c1c0 101179 
nbd_3.12.1-1.diff.gz
 301288453cfb8771e39b582d8d29a5c22826fd2a69bc3ed797d61c711a779c94 9654 
nbd-client-udeb_3.12.1-1_amd64.udeb
 0901e4c217685a4685f62981df48d57ff5fa40b49b397053e76161e07a00d307 65226 
nbd-client_3.12.1-1_amd64.deb
 90f695260ec85c2b8103043cf79e4ead3b920be53b8d0210accdd1d65b550ba6 72746 
nbd-server_3.12.1-1_amd64.deb
Files:
 9bb41fde9b5fbfbe84b13f0c7f260b7c 1934 admin optional nbd_3.12.1-1.dsc
 abb294ce37c2d9395da4e4c05989f97b 968960 admin optional nbd_3.12.1.orig.tar.gz
 bc3fbae0c8fa375ed1f053ca236eb255 101179 admin optional nbd_3.12.1-1.diff.gz
 8db974302e5c7e80e1fd316f384e1531 9654 debian-installer optional 
nbd-client-udeb_3.12.1-1_amd64.udeb
 770351ea2b6025c526f825574862220c 65226 admin optional 
nbd-client_3.12.1-1_amd64.deb
 51e4e06ed58b3bafc8d04faf539f5628 72746 admin optional 
nbd-server_3.12.1-1_amd64.deb
Package-Type: udeb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQIcBAEBAgAGBQJWdnw7AAoJEMKUD5Ub3wqdWm8P/0d6VnCM3Vfs+4qW+dlVip4A
aq4PqeCQ7/p8a/6BE5XdIoLUnqJIMOp9c3SMQe8+eX53Fuyo7vlDVOPQqgp8jc65
O6Ta3PbfVGLz16zR9cFr2q/VXVG2nOagPt9d5iFAN5fiRU+Ksyk57uXhZ8M3nsJS
Ii+SXDmc2TPfTaX7yZLE6CB4YaEMp7XZBSlghPKFavdrk04wmxF6+mR6I1au894v
wv2iplS7fZMyY3fMEsLBCTvFbc1fkUl1CtzBuWUjquWNbQs2hzV3lmEwRzjvUgIn
nUW6i6ZUih92L0FXbjvcSixvDG8OuQ8VkH8nHdE80QFCVQ+hPIXBfd5KtXjkWkRb
245y3MBg2LX7eAtfPkN+VOgJKMNoPkglS9DK8Fo7Jcn6rwhmxFDWyYuSifWUdLaW
eJoU9xKRS4mt/K43FS3IE6guqJH1Rb9jAE9Yb+Eu0Tj1PPWJBFwedcPWCbQgd7x4
xyKcdjf9t5uOteI5E7UOZhWqXLkp1QmosK+QudugNcHnvARGkJ+q/PSAZQoPLkS3
Lv5Ko2Epip+r+i7tCrBbcfMLi5i/knmmb69kPis3kx3/T5mgruWE+Y8ujYHTonQp
GSSV4Fcxl35KjK5Uohe74S2Lczpcmc7K0GCpse6d2F70ZFiSi0pbsbtvySuM1EUu
LqGMXpF8Ug4bXCY89jqF
=b3Cf
-----END PGP SIGNATURE-----

--- End Message ---

Reply via email to