• Lars Ellenberg's avatar
    drbd: avoid to shrink max_bio_size due to peer re-configuration · 35f47ef1
    Lars Ellenberg authored
    For a long time, the receiving side has spread "too large" incoming
    requests over multiple bios.  No need to shrink our max_bio_size
    (max_hw_sectors) if the peer is reconfigured to use a different storage.
    
    The problem manifests itself if we are not the top of the device stack
    (DRBD is used a LVM PV).
    
    A hardware reconfiguration on the peer may cause the supported
    max_bio_size to shrink, and the connection handshake would now
    unnecessarily shrink the max_bio_size on the active node.
    
    There is no way to notify upper layers that they have to "re-stack"
    their limits. So they won't notice at all, and may keep submitting bios
    that are suddenly considered "too large for device".
    
    We already check for compatibility and ignore changes on the peer,
    the code only was masked out unless we have a fully established connection.
    We just need to allow it a bit earlier during the handshake.
    
    Also consider max_hw_sectors in our merge bvec function, just in case.
    Signed-off-by: default avatarPhilipp Reisner <philipp.reisner@linbit.com>
    Signed-off-by: default avatarLars Ellenberg <lars.ellenberg@linbit.com>
    Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
    35f47ef1
drbd_req.c 41.4 KB