1. 23 3月, 2013 3 次提交
    • L
      drbd: prepare for new striped layout of activity log · 3a4d4eb3
      Lars Ellenberg 提交于
      Introduce two new on-disk meta data fields: al_stripes and al_stripe_size_4k
      The intended use case is activity log on RAID 0 or similar.
      Logically consecutive transactions will advance their on-disk position
      by al_stripe_size_4k 4kB (transaction sized) blocks.
      
      Right now, these are still asserted to be the backward compatible
      values al_stripes = 1, al_stripe_size_4k = 8 (which amounts to 32kB).
      
      Also introduce a caching member for meta_dev_idx in the in-core
      structure: even though it is initially passed in in the rcu-protected
      disk_conf structure, it cannot change without a detach/attach cycle.
      Signed-off-by: NPhilipp Reisner <philipp.reisner@linbit.com>
      Signed-off-by: NLars Ellenberg <lars.ellenberg@linbit.com>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      3a4d4eb3
    • L
      drbd: cleanup ondisk meta data layout calculations and defines · ae8bf312
      Lars Ellenberg 提交于
      Add a comment about our meta data layout variants,
      and rename a few defines (e.g. MD_RESERVED_SECT -> MD_128MB_SECT)
      to make it clear that they are short hand for fixed constants,
      and not arbitrarily to be redefined as one may see fit.
      
      Properly pad struct meta_data_on_disk to 4kB,
      and initialize to zero not only the first 512 Byte,
      but all of it in drbd_md_sync().
      Signed-off-by: NPhilipp Reisner <philipp.reisner@linbit.com>
      Signed-off-by: NLars Ellenberg <lars.ellenberg@linbit.com>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      ae8bf312
    • L
      drbd: cleanup bogus assert message · 9114d795
      Lars Ellenberg 提交于
      This fixes ASSERT( mdev->state.disk == D_FAILED ) in drivers/block/drbd/drbd_main.c
      
      When we detach from local disk, we let the local refcount hit zero twice.
      
      First, we transition to D_FAILED, so we won't give out new references
      to incoming requests; we still may give out *internal* references, though.
      Once the refcount hits zero [1] while in D_FAILED, we queue a transition
      to D_DISKLESS to our worker.  We need to queue it, because we may be in
      atomic context when putting the reference.
      Once the transition to D_DISKLESS actually happened [2] from worker context,
      we don't give out new internal references either.
      
      Between hitting zero the first time [1] and actually transition to
      D_DISKLESS [2], there may be a few very short lived internal get/put,
      so we may hit zero more than once while being in D_FAILED, or even see a
      race where a an internal get_ldev() happened while D_FAILED, but the
      corresponding put_ldev() happens just after the transition to D_DISKLESS.
      
      That's why we have the additional test_and_set_bit(GO_DISKLESS,);
      and that's why the assert was placed wrong.
      Since there was exactly one code path left to drbd_go_diskless(),
      and that checks already for D_FAILED, drop that assert,
      and fold in the drbd_queue_work().
      Signed-off-by: NPhilipp Reisner <philipp.reisner@linbit.com>
      Signed-off-by: NLars Ellenberg <lars.ellenberg@linbit.com>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      9114d795
  2. 28 2月, 2013 1 次提交
  3. 22 1月, 2013 1 次提交
    • L
      drbd: fix potential protocol error and resulting disconnect/reconnect · 2681f7f6
      Lars Ellenberg 提交于
      When we notice a disk failure on the receiving side,
      we stop sending it new incoming writes.
      
      Depending on exact timing of various events, the same transfer log epoch
      could end up containing both replicated (before we noticed the failure)
      and local-only requests (after we noticed the failure).
      
      The sanity checks in tl_release(), called when receiving a
      P_BARRIER_ACK, check that the ack'ed transfer log epoch matches
      the expected epoch, and the number of contained writes matches
      the number of ack'ed writes.
      
      In this case, they counted both replicated and local-only writes,
      but the peer only acknowledges those it has seen.  We get a mismatch,
      resulting in a protocol error and disconnect/reconnect cycle.
      
      Messages logged are
        "BAD! BarrierAck #%u received with n_writes=%u, expected n_writes=%u!\n"
      
      A similar issue can also be triggered when starting a resync while
      having a healthy replication link, by invalidating one side, forcing a
      full sync, or attaching to a diskless node.
      
      Fix this by closing the current epoch if the state changes in a way
      that would cause the replication intent of the next write.
      
      Epochs now contain either only non-replicated,
      or only replicated writes.
      Signed-off-by: NPhilipp Reisner <philipp.reisner@linbit.com>
      Signed-off-by: NLars Ellenberg <lars.ellenberg@linbit.com>
      2681f7f6
  4. 06 12月, 2012 5 次提交
  5. 01 12月, 2012 1 次提交
    • J
      drbd: fixup after wait_even_lock_irq() addition to generic code · 2cecb730
      Jens Axboe 提交于
      Compiling drbd yields:
      
      drivers/block/drbd/drbd_state.c: In function ‘_conn_request_state’:
      drivers/block/drbd/drbd_state.c:1804:5: error: macro "wait_event_lock_irq" passed 4 arguments, but takes just 3
      drivers/block/drbd/drbd_state.c:1801:3: error: ‘wait_event_lock_irq’ undeclared (first use in this function)
      drivers/block/drbd/drbd_state.c:1801:3: note: each undeclared identifier is reported only once for each function it appears in
      drivers/block/drbd/drbd_state.c: At top level:
      drivers/block/drbd/drbd_state.c:1734:1: warning: ‘_conn_rq_cond’ defined but not used [-Wunused-function]
      
      Due to drbd having copied the MD definition for wait_event_lock_irq()
      as well. Kill them.
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      2cecb730
  6. 09 11月, 2012 29 次提交