Blame SOURCES/0006-v2v-it-vddk-Don-t-use-nbdkit-readahead-filter-with-V.patch

61e9b3
From 4e0b3de57486613c8f28ef7726df728cccd7624b Mon Sep 17 00:00:00 2001
61e9b3
From: "Richard W.M. Jones" <rjones@redhat.com>
61e9b3
Date: Thu, 28 May 2020 10:59:57 +0100
61e9b3
Subject: [PATCH] v2v: -it vddk: Don't use nbdkit readahead filter with VDDK
61e9b3
 (RHBZ#1832805).
61e9b3
61e9b3
This filter deliberately tries to coalesce reads into larger requests.
61e9b3
Unfortunately VMware has low limits on the size of requests it can
61e9b3
serve to a VDDK client and the larger requests would break with errors
61e9b3
like this:
61e9b3
61e9b3
  nbdkit: vddk[3]: error: [NFC ERROR] NfcFssrvrProcessErrorMsg: received NFC error 5 from server: Failed to allocate the requested 33554456 bytes
61e9b3
61e9b3
We already increase the maximum request size by changing the
61e9b3
configuration on the VMware server, but it's not sufficient for VDDK
61e9b3
with the readahead filter.
61e9b3
61e9b3
As readahead is only an optimization, the simplest solution is to
61e9b3
disable this filter when we're using nbdkit-vddk-plugin.
61e9b3
61e9b3
Thanks: Ming Xie
61e9b3
(cherry picked from commit 1438174488f111fa24420758ba3bf0218dc9ee2a)
61e9b3
---
61e9b3
 v2v/nbdkit_sources.ml | 8 ++++++--
61e9b3
 1 file changed, 6 insertions(+), 2 deletions(-)
61e9b3
61e9b3
diff --git a/v2v/nbdkit_sources.ml b/v2v/nbdkit_sources.ml
61e9b3
index 402dfd0e..bfda91a7 100644
61e9b3
--- a/v2v/nbdkit_sources.ml
61e9b3
+++ b/v2v/nbdkit_sources.ml
61e9b3
@@ -97,9 +97,13 @@ let common_create ?bandwidth ?extra_debug ?extra_env plugin_name plugin_args =
61e9b3
   let cmd = Nbdkit.add_filter_if_available cmd "retry" in
61e9b3
 
61e9b3
   (* Adding the readahead filter is always a win for our access
61e9b3
-   * patterns.  However if it doesn't exist don't worry.
61e9b3
+   * patterns.  If it doesn't exist don't worry.  However it
61e9b3
+   * breaks VMware servers (RHBZ#1832805).
61e9b3
    *)
61e9b3
-  let cmd = Nbdkit.add_filter_if_available cmd "readahead" in
61e9b3
+  let cmd =
61e9b3
+    if plugin_name <> "vddk" then
61e9b3
+      Nbdkit.add_filter_if_available cmd "readahead"
61e9b3
+    else cmd in
61e9b3
 
61e9b3
   (* Caching extents speeds up qemu-img, especially its consecutive
61e9b3
    * block_status requests with req_one=1.
61e9b3
-- 
61e9b3
2.27.0
61e9b3