As described here:
  https://www.mail-archive.com/[email protected]/msg03878.html

NBD clients prior to 3.10 incorrectly attempt to merge the server flags
with the transmission flags. This means that any such client cannot connect
to a server (e.g. NBD server post 3.10, gonbdserver) which supports
NBD_FLAG_NO_ZEROES without making the export read-only.

This one line fix avoids the issue by simply passing the kernel the
transmission flags without an attempt to merge them. This is the
behaviour nbd-client (post 3.10) does, and also qemu's current behaviour.

Signed-off-by: Alex Bligh <[email protected]>
---
 nbd-client.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/nbd-client.c b/nbd-client.c
index cc9a06e..ddc849c 100644
--- a/nbd-client.c
+++ b/nbd-client.c
@@ -318,7 +318,7 @@ void negotiate(int sock, u64 *rsize64, u32 *flags, char* 
name, uint32_t needed_f
        } else {
                if(read(sock, &tmp, sizeof(tmp)) < 0)
                        err("Failed/4: %m\n");
-               *flags |= (uint32_t)ntohs(tmp);
+               *flags = (uint32_t)ntohs(tmp);
        }
 
        if (read(sock, &buf, 124) < 0)
-- 
1.9.1


------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
Nbd-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nbd-general

Reply via email to