Skip to content
  • Eric Blake's avatar
    5c86bdf1
    block: Call attention to truncation of long NBD exports · 5c86bdf1
    Eric Blake authored
    Commit 93676c88 relaxed our NBD client code to request export names up
    to the NBD protocol maximum of 4096 bytes without NUL terminator, even
    though the block layer can't store anything longer than 4096 bytes
    including NUL terminator for display to the user.  Since this means
    there are some export names where we have to truncate things, we can
    at least try to make the truncation a bit more obvious for the user.
    Note that in spite of the truncated display name, we can still
    communicate with an NBD server using such a long export name; this was
    deemed nicer than refusing to even connect to such a server (since the
    server may not be under our control, and since determining our actual
    length limits gets tricky when nbd://host:port/export and
    nbd+unix:///export?socket=/path
    
     are themselves variable-length
    expansions beyond the export name but count towards the block layer
    name length).
    
    Reported-by: default avatarXueqiang Wei <xuwei@redhat.com>
    Fixes: https://bugzilla.redhat.com/1843684
    
    
    Signed-off-by: default avatarEric Blake <eblake@redhat.com>
    Reviewed-by: default avatarVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
    Message-Id: <20200610163741.3745251-3-eblake@redhat.com>
    5c86bdf1
    block: Call attention to truncation of long NBD exports
    Eric Blake authored
    Commit 93676c88 relaxed our NBD client code to request export names up
    to the NBD protocol maximum of 4096 bytes without NUL terminator, even
    though the block layer can't store anything longer than 4096 bytes
    including NUL terminator for display to the user.  Since this means
    there are some export names where we have to truncate things, we can
    at least try to make the truncation a bit more obvious for the user.
    Note that in spite of the truncated display name, we can still
    communicate with an NBD server using such a long export name; this was
    deemed nicer than refusing to even connect to such a server (since the
    server may not be under our control, and since determining our actual
    length limits gets tricky when nbd://host:port/export and
    nbd+unix:///export?socket=/path
    
     are themselves variable-length
    expansions beyond the export name but count towards the block layer
    name length).
    
    Reported-by: default avatarXueqiang Wei <xuwei@redhat.com>
    Fixes: https://bugzilla.redhat.com/1843684
    
    
    Signed-off-by: default avatarEric Blake <eblake@redhat.com>
    Reviewed-by: default avatarVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
    Message-Id: <20200610163741.3745251-3-eblake@redhat.com>
Loading