Uploaded image for project: 'OpenShift Virtualization'
  1. OpenShift Virtualization
  2. CNV-50601

VDDK: Fix NBD status coalescing for large blocks

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done-Errata
    • Icon: Critical Critical
    • CNV v4.15.7
    • CNV v4.15.0
    • Storage Platform
    • None
    • 8
    • False
    • Hide

      None

      Show
      None
    • False
    • None
    • ---
    • ---
    • Storage Core Sprint 262
    • None

      Description of problem:

      This pull request fixes the logic error pointed out in #3054, where the VDDK importer tries to merge smaller blocks into one big one, when mapping out the NBD status flags (basically zero, hole, or data) from the source disk. This code was incorrectly neglecting to add the length of the current block to the length of the previous block, so the combined result had the wrong length.
      
      This pull request also avoids a potential integer overflow by changing the type of the struct field that receives this block length from a uint32 to an int64. It further changes the offset field in the same struct from a uint64 to an int64, to avoid a bunch of haphazard integer conversions. There are a few new conversions, but the net result is a bit more confidence-inspiring.
      
      This pull request also adds unit tests for GetBlockStatus, and fixes and alignment issue in the multi-stage VDDK documentation that tripped me up when trying to remember how to test this stuff.
      
      Issue and fix in https://github.com/kubevirt/containerized-data-importer/pull/3242
      

      Version-Release number of selected component (if applicable):

      4.15
      
      

      How reproducible:

      
      

      Steps to Reproduce:

      1.
      2.
      3.
      

      Actual results:

      
      

      Expected results:

      
      

      Additional info:

      
      

              ngavrilo@redhat.com Natalie Gavrielov
              fdeutsch@redhat.com Fabian Deutsch
              Kevin Alon Goldblatt Kevin Alon Goldblatt
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: