GitHub/moto-9609/android_kernel_motorola_exynos9610.git
12 years agodrbd: If disk timeout expires fail only the affected volume
Philipp Reisner [Thu, 23 Feb 2012 11:18:11 +0000 (12:18 +0100)]
drbd: If disk timeout expires fail only the affected volume

...and not all volumes of the resource

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
12 years agodrbd: Consider the disk-timeout also for meta-data IO operations
Philipp Reisner [Wed, 22 Feb 2012 10:51:57 +0000 (11:51 +0100)]
drbd: Consider the disk-timeout also for meta-data IO operations

If the backing device is already frozen during attach, we failed
to recognize that. The current disk-timeout code works on top
of the drbd_request objects. During attach we do not allow IO
and therefore never generate a drbd_request object but block
before that in drbd_make_request().

This patch adds the timeout to all drbd_md_sync_page_io().

Before this patch we used to go from D_ATTACHING directly
to D_DISKLESS if IO failed during attach. We can no longer
do this since we have to stay in D_FAILED until all IO
ops issued to the backing device returned.

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
12 years agodrbd: Reinstate disabling AL updates with invalidate-remote
Philipp Reisner [Tue, 14 Feb 2012 11:12:35 +0000 (12:12 +0100)]
drbd: Reinstate disabling AL updates with invalidate-remote

Commit d0ef827e (drbd: switch configuration interface from connector to
genetlink) introduced a regression by removing the ability to set all
bits in the out of sync bitmap and to suspend updates to the activity log
of a disconnected device via the invalidate-remote management call.

Credits for reporting the issue are going to Arne Redlich.

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
12 years agodrbd: explicitly clear unused dp_flags in drbd_send_block
Lars Ellenberg [Wed, 8 Feb 2012 14:32:51 +0000 (15:32 +0100)]
drbd: explicitly clear unused dp_flags in drbd_send_block

We send left-over garbage from the previous packet in P_DATA_REPLY and
P_RS_DATA_REPLY packets. That's bad behaviour.

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
12 years agodrbd: Fixed compat issue with disconnecting 8.4 from a primary 8.3
Philipp Reisner [Fri, 20 Jan 2012 12:52:27 +0000 (13:52 +0100)]
drbd: Fixed compat issue with disconnecting 8.4 from a primary 8.3

For compatibility reasons 8.4 has to send P_STATE_CHG_REQ (instead
of P_CONN_ST_CHG_REQ) when disconnecting.

In the receiving code path we missed to convert the old
answer (P_STATE_CHG_REPLY) back to 8.4 logic. Therefore
the CL_ST_CHG_SUCCESS or CL_ST_CHG_FAIL bit in the flags word
of mdev got set, while the state code was waiting for
the CONN_WD_ST_CHG_OKAY or CONN_WD_ST_CHG_FAIL bits in tconn.

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
12 years agodrbd: drbd_bm_ALe_set_all(): Remove unused function
Andreas Gruenbacher [Thu, 29 Dec 2011 23:28:23 +0000 (00:28 +0100)]
drbd: drbd_bm_ALe_set_all(): Remove unused function

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
12 years agodrbd: restart loop in drbd_make_request() [prepare for Linux-3.2]
Philipp Reisner [Tue, 20 Dec 2011 10:49:58 +0000 (11:49 +0100)]
drbd: restart loop in drbd_make_request() [prepare for Linux-3.2]

With Linux-3.2 generic_make_request() will no longer loop over
the request function until it finally returns 0. Move this
loop into our drbd_make_request() function.

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
12 years agodrbd: Restore late assigning of tconn->data.sock and meta.sock
Philipp Reisner [Mon, 19 Dec 2011 21:42:56 +0000 (22:42 +0100)]
drbd: Restore late assigning of tconn->data.sock and meta.sock

With commit from Mon Mar 28 16:33:12 2011 +0200
"drbd: drbd_connect(): Initialize struct drbd_socket before sending anything"

tconn->data.sock and tconn->meta.sock get assigned early, in
conn_connect.

The early assigning can trigger an OOPS, because it may released the socket
without acquiring the mutex protecting the socket. An other thread (worker)
might use setsockopt() on the socket while it gets free()ed.

Restored the (proven) 8.3 behavior of assigning these sockets after the two
connections are established.

Credits for reporting the issue are going to Arne Redlich.

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
12 years agodrbd: Log failures of connection state changes
Philipp Reisner [Tue, 13 Dec 2011 16:40:53 +0000 (17:40 +0100)]
drbd: Log failures of connection state changes

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
12 years agodrbd: Consider that read requests could be NEG_ACKEDed
Philipp Reisner [Tue, 13 Dec 2011 10:36:57 +0000 (11:36 +0100)]
drbd: Consider that read requests could be NEG_ACKEDed

ap_in_flight only counts writes. NEG_ACKED is an action
on a request that might be called for reads and writes.

This bug was there forever, but it becomes much more
relevant with the read balincing code.

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
12 years agodrbd: Do not send state packets while lower than C_CONNECTED cstate
Philipp Reisner [Tue, 13 Dec 2011 17:32:18 +0000 (18:32 +0100)]
drbd: Do not send state packets while lower than C_CONNECTED cstate

I.e. in C_WF_REPORT_PARAMS or in C_WF_CONNECTION.
Sending may already work in these cstates, but the peer still expects
the HandShake / ConnectionFeatures packet.

Actually triggered by the Testuite on kugel.

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
12 years agodrbd: fix race between disconnect and receive_state
Philipp Reisner [Tue, 13 Dec 2011 10:09:16 +0000 (11:09 +0100)]
drbd: fix race between disconnect and receive_state

If the asender thread, or request_timer_fn(), or some other part of
the code, decided to drop the connection (because of timeout or other),
but the receiver just now was processing a P_STATE packet, there was a
chance that receive_state() would do a hard state change
"re-establishing" an already failed connection without additional handshake.

Log excerpt:
  Remote failed to finish a request within ko-count * timeout
  peer( Secondary -> Unknown ) conn( Connected -> Timeout ) pdsk( UpToDate -> DUnknown )
  asender terminated
  ...
  peer( Unknown -> Secondary ) conn( Timeout -> Connected ) pdsk( DUnknown -> UpToDate ) peer_isp( 0 -> 1 )
  ...
  Connection closed
  peer( Secondary -> Unknown ) conn( Connected -> Unconnected ) pdsk( UpToDate -> DUnknown ) peer_isp( 1 -> 0 )
  receiver terminated

Impact:
while the connection state is erroneously "Connected",
requests may be queued and even sent,
which would never be acknowledged,
and may have been missed by the cleanup.
These requests would never be completed.

The next drbd_suspend_io() will then lock up,
waiting forever for these requests to complete.

Fixed in several code paths:
  Make sure the connection state is NetworkFailure or worse
  before starting the cleanup in drbd_disconnect().
  This should make sure the cleanup won't miss any requests.

  Disallow receive_state() to "upgrade" the connection state
  from an error state. This will make sure the "illegal" state
  transition won't happen.

  For all connection failure states,
  relax the safe-guard in sanitize_state() again
  to silently mask out those state changes
  (e.g. Timeout -> Connected becomes Timeout -> Timeout).

 Note by Philipp Reisner:
  The 3rd chunk described as "relax the safe-guard..."
  is not there in 8.4 as it is relaxed to the maximum in
  8.4 already

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
12 years agodrbd: Do not call generic_make_request() while holding req_lock
Philipp Reisner [Sat, 3 Dec 2011 10:18:56 +0000 (11:18 +0100)]
drbd: Do not call generic_make_request() while holding req_lock

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
12 years agodrbd: Load balancing method: striping
Philipp Reisner [Thu, 17 Nov 2011 09:12:31 +0000 (10:12 +0100)]
drbd: Load balancing method: striping

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
12 years agodrbd: Load balancing of read requests
Philipp Reisner [Fri, 11 Nov 2011 11:31:20 +0000 (12:31 +0100)]
drbd: Load balancing of read requests

New config option for the disk secition "read-balancing", with
the values: prefer-local, prefer-remote, round-robin, when-congested-remote.

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
12 years agodrbd: Get rid of "ASSERTION FAILED: tconn->current_epoch->list not empty"
Philipp Reisner [Wed, 30 Nov 2011 22:25:36 +0000 (23:25 +0100)]
drbd: Get rid of "ASSERTION FAILED: tconn->current_epoch->list not empty"

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
12 years agodrbd: add missing rcu locks around recently introduced idr_for_each
Lars Ellenberg [Thu, 17 Nov 2011 13:32:12 +0000 (14:32 +0100)]
drbd: add missing rcu locks around recently introduced idr_for_each

Recent commit
 drbd: Move write_ordering from mdev to tconn
introduced a new idr_for_each loop over all volumes,
but did not take necessary rcu locks or krefs.

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
12 years agodrbd: Remove leftover prototype
Andreas Gruenbacher [Thu, 17 Nov 2011 10:32:01 +0000 (11:32 +0100)]
drbd: Remove leftover prototype

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
12 years agodrbd: fix potential spinlock deadlock
Philipp Reisner [Thu, 17 Nov 2011 09:11:47 +0000 (10:11 +0100)]
drbd: fix potential spinlock deadlock

drbd_try_clear_on_disk_bm() has a sanity check for the number of blocks
left to be resynced (rs_left) in the current resync extent.
If it detects a mismatch, it complains, and forces a disconnect using
drbd_force_state(mdev, NS(conn, C_DISCONNECTING));

Unfortunately, this may be called while holding the req_lock,
and drbd_force_state() want's to aquire that lock itself. Deadlock.

Don't force a disconnect, but fix up rs_left by recounting and
reassigning the number of dirty blocks in that extent.

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
12 years agodrbd: Fix the WO=drain implementation for multiple volumes
Philipp Reisner [Thu, 10 Nov 2011 20:19:11 +0000 (21:19 +0100)]
drbd: Fix the WO=drain implementation for multiple volumes

Wait until IO is drained in all volumes.

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
12 years agodrbd: Switch drbd_may_finish_epoch() from mdev to tconn
Philipp Reisner [Thu, 10 Nov 2011 14:14:53 +0000 (15:14 +0100)]
drbd: Switch drbd_may_finish_epoch() from mdev to tconn

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
12 years agodrbd: Move list of epochs from mdev to tconn
Philipp Reisner [Wed, 9 Nov 2011 18:18:00 +0000 (19:18 +0100)]
drbd: Move list of epochs from mdev to tconn

This is necessary since the transfer_log on the sending is also
per tconn.

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
12 years agodrbd: Prepare epochs per connection
Philipp Reisner [Thu, 10 Nov 2011 13:56:07 +0000 (14:56 +0100)]
drbd: Prepare epochs per connection

An epoch object needs a pointer to the mdev it was received for.
This is necessary to be able to send the barrier ack packet for
the same volume as the original barrier packet was assigned to.

This prepares the next step, in which the (receiver side)
epoch list is moved from the device (mdev) to the connection (tconn)
object.

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
12 years agodrbd: Move write_ordering from mdev to tconn
Philipp Reisner [Wed, 9 Nov 2011 19:12:34 +0000 (20:12 +0100)]
drbd: Move write_ordering from mdev to tconn

This is necessary in order to prepare the move of the (receiver side)
epoch list from the device (mdev) to the connection (tconn) objects.

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
12 years agodrbd: Move the CREATE_BARRIER flag from connection to device
Philipp Reisner [Thu, 10 Nov 2011 17:45:36 +0000 (18:45 +0100)]
drbd: Move the CREATE_BARRIER flag from connection to device

That is necessary since the whole transfer log is per connection(tconn)
and not per device(mdev).

This bug caused list corruption on the worker list. When a barrier is queued
for sending in the context of one device, another device did not see the
CREATE_BARRIER bit, and queued the same object again -> list corruption.

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
12 years agodrbd: Fixed an obvious copy-n-paste mistake
Philipp Reisner [Thu, 10 Nov 2011 13:27:34 +0000 (14:27 +0100)]
drbd: Fixed an obvious copy-n-paste mistake

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
12 years agodrbd: Fixes from the drbd-8.3 branch
Philipp Reisner [Thu, 10 Nov 2011 12:16:13 +0000 (13:16 +0100)]
drbd: Fixes from the drbd-8.3 branch

* drbd-8.3:
  drbd: O_SYNC gives EIO on ramdisks for some kernels (eg. RHEL6).
  drbd: send intermediate state change results to the peer

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
12 years agodrbd: Fixes from the drbd-8.3 branch
Philipp Reisner [Thu, 10 Nov 2011 11:12:52 +0000 (12:12 +0100)]
drbd: Fixes from the drbd-8.3 branch

* drbd-8.3:
  drbd: fix spurious meta data IO "error"
  drbd: Fixed a race condition between detach and start of resync
  drbd: fix harmless race to not trigger an ASSERT
  drbd: Derive sync-UUIDs only from the bitmap-uuid if it is non-zero
  drbd: Fixed current UUID generation (regression introduced recently, after 8.3.11)

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
12 years agodrbd: Silenced compiler warnings
Philipp Reisner [Mon, 7 Nov 2011 09:54:28 +0000 (10:54 +0100)]
drbd: Silenced compiler warnings

Since version 4.6.1 gcc warns about variables that get
a value assigned, but which are never read later on.

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
12 years agodrbd: fix "stalled" empty resync
Philipp Reisner [Thu, 29 Sep 2011 11:00:14 +0000 (13:00 +0200)]
drbd: fix "stalled" empty resync

With sync-after dependencies, given "lucky" timing of pause/unpause
events, and the end of an empty (0 bits set) resync was sometimes not
detected on the SyncTarget, leading to a "stalled" SyncSource state.

Fixed this by expecting not only "Inconsistent -> UpToDate" but also
"Consistent -> UpToDate" transitions for the peer disk state
to end a resync.

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
12 years agodrbd: fix bitmap writeout after aborted resync
Lars Ellenberg [Mon, 26 Sep 2011 07:58:04 +0000 (09:58 +0200)]
drbd: fix bitmap writeout after aborted resync

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
12 years agodrbd: Consider the discard-my-data flag for all volumes [bugz 359]
Philipp Reisner [Mon, 5 Sep 2011 14:22:33 +0000 (16:22 +0200)]
drbd: Consider the discard-my-data flag for all volumes [bugz 359]

...not only for the first volume

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
12 years agodrbd: Improve error reporting in drbd_md_sync_page_io()
Andreas Gruenbacher [Fri, 19 Aug 2011 11:47:31 +0000 (13:47 +0200)]
drbd: Improve error reporting in drbd_md_sync_page_io()

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
12 years agodrbd: fix connect failure with all default net-options
Lars Ellenberg [Fri, 19 Aug 2011 08:39:00 +0000 (10:39 +0200)]
drbd: fix connect failure with all default net-options

If no net-options are configured (all on their default),
no DRBD_NLA_NET_CONF will be passed to the kernel.
The kernel must not require its presence,
there is no required option in there.

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
12 years agodrbd: Update some outdated comments to match the code
Andreas Gruenbacher [Wed, 17 Aug 2011 10:43:25 +0000 (12:43 +0200)]
drbd: Update some outdated comments to match the code

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
12 years agodrbd: Remove unused code
Philipp Reisner [Tue, 16 Aug 2011 09:59:43 +0000 (11:59 +0200)]
drbd: Remove unused code

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
12 years agodrbd: Remove dead code
Philipp Reisner [Thu, 16 Jun 2011 15:58:02 +0000 (17:58 +0200)]
drbd: Remove dead code

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
12 years agodrbd: Cleanup all epoch objects upon connection loss
Philipp Reisner [Mon, 18 Jul 2011 13:45:15 +0000 (15:45 +0200)]
drbd: Cleanup all epoch objects upon connection loss

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
12 years agodrbd: The minor_count module parameter is only a hint nowadays
Philipp Reisner [Mon, 18 Jul 2011 09:09:17 +0000 (11:09 +0200)]
drbd: The minor_count module parameter is only a hint nowadays

* The max of minor_count is 255
* In drbdadm count the number of minors, instead of finding
  the highest minor number
* No longer us the magic in the init script

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
12 years agodrbd: Do not display bogus log lines for pdsk in case pdsk < D_UNKNOWN
Philipp Reisner [Mon, 18 Jul 2011 08:44:24 +0000 (10:44 +0200)]
drbd: Do not display bogus log lines for pdsk in case pdsk < D_UNKNOWN

This was a regression recently introduced with commit
7848ddb752c09b6dfd1ddfabb06b69b08aa8f6b9
"drbd: Correctly handle resources without volumes"

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
12 years agodrbd: detach must not try to abort non-local requests
Lars Ellenberg [Fri, 15 Jul 2011 21:52:44 +0000 (23:52 +0200)]
drbd: detach must not try to abort non-local requests

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
12 years agodrbd: Get rid of MR_{READ,WRITE}_SHIFT
Andreas Gruenbacher [Sun, 17 Jul 2011 21:06:12 +0000 (23:06 +0200)]
drbd: Get rid of MR_{READ,WRITE}_SHIFT

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
12 years agodrbd: Bugfix for the connection behavior
Philipp Reisner [Thu, 8 Nov 2012 14:04:36 +0000 (15:04 +0100)]
drbd: Bugfix for the connection behavior

If we get into the C_BROKEN_PIPE cstate once, the state engine set the
thi->t_state of the receiver thread to restarting.  But with the while loop
in drbdd_init() a new connection gets established. After the call into
drbdd() returns immediately since the thi->t_state is not RUNNING.  The
restart of drbd_init() then resets thi->t_state to RUNNING.

I.e. after entering C_BROKEN_PIPE once, the next successful established
connection gets wasted.

The two parts of the fix:
  * Do not cause the thread to restart if we detect the issue
    with the sockets while we are in C_WF_CONNECTION.

  * Make sure that all actions that would have set us to C_BROKEN_PIPE
    happen before the state change to C_WF_REPORT_PARAMS.

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
12 years agodrbd: Fix the data-integrity-alg setting
Andreas Gruenbacher [Sun, 17 Jul 2011 21:06:12 +0000 (23:06 +0200)]
drbd: Fix the data-integrity-alg setting

The last data-integrity-alg fix made data integrity checking work when the
algorithm was changed for an established connection, but the common case of
configuring the algorithm before connecting was still broken.  Fix that.

Signed-off-by: Andreas Gruenbacher <agruen@linbit.com>
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
12 years agodrbd: Turn tl_apply() into tl_abort_disk_io()
Andreas Gruenbacher [Sun, 17 Jul 2011 21:06:12 +0000 (23:06 +0200)]
drbd: Turn tl_apply() into tl_abort_disk_io()

There is no need to overly generalize this function; it only makes the code
harder to understand.

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
12 years agodrbd: Fixed w_restart_disk_io() to handle non active AL-extents
Philipp Reisner [Fri, 15 Jul 2011 15:19:02 +0000 (17:19 +0200)]
drbd: Fixed w_restart_disk_io() to handle non active AL-extents

Since we now apply the AL in user space onto the bitmap, the AL
is not active for the requests we want to reply.

For that a al_write_transaction() that might be called from
worker context became necessary.

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
12 years agodrbd: Missing assignment of mdev before drbd_queue_work()
Philipp Reisner [Fri, 15 Jul 2011 16:15:45 +0000 (18:15 +0200)]
drbd: Missing assignment of mdev before drbd_queue_work()

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
12 years agodrbd: Do not mod_timer() with a past time
Philipp Reisner [Fri, 15 Jul 2011 11:53:06 +0000 (13:53 +0200)]
drbd: Do not mod_timer() with a past time

In case we can not find out why the request takes too long
(happens e.g. when IO got suspended on DRBD level). rearm
the timer with a reasonable value.

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
12 years agodrbd: Consider that the no-data-condition could be in connected state
Philipp Reisner [Fri, 15 Jul 2011 16:44:26 +0000 (18:44 +0200)]
drbd: Consider that the no-data-condition could be in connected state

...when the peer has inconsistent data. In that case we failed to
clear the susp_nod flag. When the local disk was attached again

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
12 years agodrbd: Dropped wrong clause to generate new current UUIDs
Philipp Reisner [Fri, 15 Jul 2011 10:14:27 +0000 (12:14 +0200)]
drbd: Dropped wrong clause to generate new current UUIDs

Looks like a remainder from long ago.

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
12 years agodrbd: receive_protocol(): We cannot change our own data-integrity-alg setting here
Andreas Gruenbacher [Fri, 15 Jul 2011 15:41:09 +0000 (17:41 +0200)]
drbd: receive_protocol(): We cannot change our own data-integrity-alg setting here

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
12 years agodrbd: Be consistent in reporting incompatibilities in P_PROTOCOL settings
Andreas Gruenbacher [Fri, 15 Jul 2011 15:19:18 +0000 (17:19 +0200)]
drbd: Be consistent in reporting incompatibilities in P_PROTOCOL settings

Refer to the settings by the names which drbdsetup and drbd.conf are using.

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
12 years agodrbd: receive_protocol(): Make the program flow less confusing
Andreas Gruenbacher [Fri, 15 Jul 2011 15:04:26 +0000 (17:04 +0200)]
drbd: receive_protocol(): Make the program flow less confusing

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
12 years agodrbd: receive_protocol(): Give variables more easily searchable names
Andreas Gruenbacher [Fri, 15 Jul 2011 14:48:49 +0000 (16:48 +0200)]
drbd: receive_protocol(): Give variables more easily searchable names

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
12 years agodrbd: Print memory address in hex instead of decimal in error message
Andreas Gruenbacher [Fri, 15 Jul 2011 07:43:23 +0000 (09:43 +0200)]
drbd: Print memory address in hex instead of decimal in error message

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
12 years agodrbd: Allow to create devices with a minor number > minor_count
Andreas Gruenbacher [Thu, 14 Jul 2011 14:00:40 +0000 (16:00 +0200)]
drbd: Allow to create devices with a minor number > minor_count

The minor_count module/kernel parameter serves to scale the size of drbd's
internal memory pool, but it is no longer a limit for the number of minors or
the minor number.  (Minor numbers can be arbitrarily high within the allowed
limit of 2^20.)

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
12 years agodrbd: Fix the maximum accepted minor device number
Andreas Gruenbacher [Wed, 13 Jul 2011 11:40:30 +0000 (13:40 +0200)]
drbd: Fix the maximum accepted minor device number

The maximum minor device number allowed by the kernel is (1<<20 - 1).  Reject
device numbers higher than that to earlier catch possible errors.

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
12 years agodrbd: Define scale factors in a single place
Andreas Gruenbacher [Mon, 9 May 2011 16:26:20 +0000 (18:26 +0200)]
drbd: Define scale factors in a single place

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
12 years agodrbd: Changed some defaults
Philipp Reisner [Wed, 13 Jul 2011 08:24:51 +0000 (10:24 +0200)]
drbd: Changed some defaults

* Enabled the resync controller, with a fill target of 50Kib. That gives
  reasonable resync speeds without tuning. A much better default than
  the 250KiB/s fixed.

* Enable bitmap compression. It is save to use, and most people have
  more CPU power than network bandwidth.

* ko-count of 7: Abort a connection if the peer fails to process a
  write request within 42 seconds.

* al-extents of 1237: ~5 GiB seems to be a much more sane default
  these days.

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
12 years agodrbd: report net config even for resources without a single volume
Lars Ellenberg [Mon, 11 Jul 2011 21:49:55 +0000 (23:49 +0200)]
drbd: report net config even for resources without a single volume

Currently it is legal (though unusual) to create and connect a resource,
before adding in all necessary volumes. We should include the network
configuration details, even if we don't have a single volume (yet).

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
12 years agodrbd: Correctly handle resources without volumes
Philipp Reisner [Mon, 11 Jul 2011 15:04:23 +0000 (17:04 +0200)]
drbd: Correctly handle resources without volumes

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
12 years agodrbd: Eliminated the "notified peer" messages
Philipp Reisner [Fri, 8 Jul 2011 12:47:45 +0000 (14:47 +0200)]
drbd: Eliminated the "notified peer" messages

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
12 years agodrbd: Fixed removal of volumes/devices from connected resources
Philipp Reisner [Wed, 6 Jul 2011 21:04:44 +0000 (23:04 +0200)]
drbd: Fixed removal of volumes/devices from connected resources

When removing a volume/device we need to switch the connection
status of the peer back into WFReportParams.

  Before this fix it was left in Connected state. That means that
  the peer device continued to inform us about state changes, etc...
  But we deleted that minor -> protocol error.

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
12 years agodrbd: on attach, enforce clean meta data
Lars Ellenberg [Tue, 5 Jul 2011 18:59:26 +0000 (20:59 +0200)]
drbd: on attach, enforce clean meta data

Detection of unclean shutdown has moved into user space.

The kernel code will, whenever it updates the meta data, mark it as
"unclean", and will refuse to attach to such unclean meta data.

"drbdadm up" now schedules "drbdmeta apply-al", which will apply
the activity log to the bitmap, and/or reinitialize it, if necessary,
as well as set a "clean" indicator flag.

This moves a bit code out of kernel space.
As a side effect, it also prevents some 8.3 module from accidentally
ignoring the 8.4 style activity log, if someone should downgrade,
whether on purpose, or accidentally because he changed kernel versions
without providing an 8.4 for the new kernel, and the new kernel comes
with in-tree 8.3.

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
12 years agodrbd: detach from frozen backing device
Philipp Reisner [Tue, 5 Jul 2011 13:38:59 +0000 (15:38 +0200)]
drbd: detach from frozen backing device

* drbd-8.3:
  documentation: Documented detach's --force and disk's --disk-timeout
  drbd: Implemented the disk-timeout option
  drbd: Force flag for the detach operation
  drbd: Allow new IOs while the local disk in in FAILED state
  drbd: Bitmap IO functions can not return prematurely if the disk breaks
  drbd: Added a kref to bm_aio_ctx
  drbd: Hold a reference to ldev while doing meta-data IO
  drbd: Keep a reference to the bio until the completion handler finished
  drbd: Implemented wait_until_done_or_disk_failure()
  drbd: Replaced md_io_mutex by an atomic: md_io_in_use
  drbd: moved md_io into mdev
  drbd: Immediately allow completion of IOs, that wait for IO completions on a failed disk
  drbd: Keep a reference to barrier acked requests

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
12 years agodrbd: Improve the "unexpected packet" error messages
Andreas Gruenbacher [Sun, 3 Jul 2011 09:41:08 +0000 (11:41 +0200)]
drbd: Improve the "unexpected packet" error messages

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
12 years agodrbd: Fixed state transitions in case reading meta data failes
Philipp Reisner [Fri, 1 Jul 2011 15:00:57 +0000 (17:00 +0200)]
drbd: Fixed state transitions in case reading meta data failes

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
12 years agodrbd: Improve compatibility with drbd's older than 8.3.7
Philipp Reisner [Thu, 30 Jun 2011 13:43:06 +0000 (15:43 +0200)]
drbd: Improve compatibility with drbd's older than 8.3.7

Regression introduced with 8.3.11 commit:
drbd: Take a more conservative approach when deciding max_bio_size

Never ever tell an older drbd, that we support more than 32KiB
in a single data request (packet).
Never believe an older drbd, that is supports more than 32KiB
in a single data request (packet)

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
12 years agodrbd: Fixes from the 8.3 development branch
Philipp Reisner [Tue, 31 May 2011 11:07:24 +0000 (13:07 +0200)]
drbd: Fixes from the 8.3 development branch

 * commit 'ae57a0a':
   drbd: Only print sanitize state's warnings, if the state change happens
   drbd: we should write meta data updates with FLUSH FUA
   drbd: fix limit define, we support 1 PiByte now
   drbd: fix log message argument order
   drbd: Typo in user-visible message.
   drbd: Make "(rcv|snd)buf-size" and "ping-timeout" available for the proxy, too.
   drbd: Allow keywords to be used in multiple config sections.
   drbd: fix typos in comments.

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
12 years agodrbd: downgraded error printk to info
Lars Ellenberg [Mon, 20 Jun 2011 23:13:37 +0000 (01:13 +0200)]
drbd: downgraded error printk to info

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
12 years agodrbd: allow ping-timeout of up to 30 seconds
Lars Ellenberg [Mon, 20 Jun 2011 20:21:19 +0000 (22:21 +0200)]
drbd: allow ping-timeout of up to 30 seconds

Allow up to 300 centi-seconds to be configured for the "ping timeout".
There may be setups where heavy congestion, huge buffers, and asymmetric
bandwidth limitations may need a "huge" ping-timeout as work-around
for "spurious connection loss" problems.

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
12 years agoDRBD: Fix comparison always false warning due to long/long long compare
David Howells [Tue, 14 Jun 2011 23:59:04 +0000 (00:59 +0100)]
DRBD: Fix comparison always false warning due to long/long long compare

Fix warnings of the following nature in the drbd header:

In file included from drivers/block/drbd/drbd_bitmap.c:32:
drivers/block/drbd/drbd_int.h: In function 'drbd_get_syncer_progress':
drivers/block/drbd/drbd_int.h:2234: warning: comparison is always false due to limited range of data

where mdev->rs_total (an unsigned long) is being compared to 1ULL << 32, which
is always false on a 32-bit machine.

Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
12 years agodrbd: Rename --dry-run to --tentative
Andreas Gruenbacher [Tue, 28 Jun 2011 12:18:12 +0000 (14:18 +0200)]
drbd: Rename --dry-run to --tentative

drbdadm already has a --dry-run option, so this option cannot directly be
passed through to drbdsetup.  Rename the drbdsetup option to resolve this
conflict.

For backward compatibility, make --dry-run an alias of --tentative.

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
12 years agodrbd: Remove dead code
Andreas Gruenbacher [Tue, 21 Jun 2011 10:58:22 +0000 (12:58 +0200)]
drbd: Remove dead code

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
12 years agodrbd: Allow to pass resource options to the new-resource command
Andreas Gruenbacher [Thu, 16 Jun 2011 15:58:02 +0000 (17:58 +0200)]
drbd: Allow to pass resource options to the new-resource command

This is equivalent to how the attach and connect commands work.

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
12 years agodrbd: Convert the generic netlink interface to accept connection endpoints
Andreas Gruenbacher [Tue, 14 Jun 2011 16:28:09 +0000 (18:28 +0200)]
drbd: Convert the generic netlink interface to accept connection endpoints

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
12 years agodrbd: Rename DRBD_ADM_NEED_{CONN -> RESOURCE}
Andreas Gruenbacher [Tue, 14 Jun 2011 14:07:32 +0000 (16:07 +0200)]
drbd: Rename DRBD_ADM_NEED_{CONN -> RESOURCE}

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
12 years agodrbd: Split off netlink mandatory attribute handling into separate file
Andreas Gruenbacher [Fri, 10 Jun 2011 10:57:26 +0000 (12:57 +0200)]
drbd: Split off netlink mandatory attribute handling into separate file

Duplicate this file in the kernel module and in user space; both sides need it.

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
12 years agodrbd: Also need to check for DRBD_GENLA_F_MANDATORY flags before nla_find_nested()
Andreas Gruenbacher [Thu, 9 Jun 2011 15:52:12 +0000 (17:52 +0200)]
drbd: Also need to check for DRBD_GENLA_F_MANDATORY flags before nla_find_nested()

This is done by introducing drbd_nla_find_nested() which handles the flag
before calling nla_find_nested().

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
12 years agodrbd: Use the terminology suggested by the command names in the source code and messages
Andreas Gruenbacher [Mon, 6 Jun 2011 14:16:44 +0000 (16:16 +0200)]
drbd: Use the terminology suggested by the command names in the source code and messages

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
12 years agodrbd: spelling fix: too small
Lars Ellenberg [Mon, 6 Jun 2011 13:36:04 +0000 (15:36 +0200)]
drbd: spelling fix: too small

It is not "to small", but "too small".

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
12 years agodrbd: cosmetic: fix accidental division instead of modulo when pretty printing
Lars Ellenberg [Fri, 3 Jun 2011 19:13:17 +0000 (21:13 +0200)]
drbd: cosmetic: fix accidental division instead of modulo when pretty printing

For large resync rates, seq_printf_with_thousands_grouping()
accidentally only produced Y,000,00Y, instead of the real numbers.

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
12 years agodrbd: Use DRBD_MINOR_COUNT_DEF in one more place
Andreas Gruenbacher [Tue, 31 May 2011 11:08:53 +0000 (13:08 +0200)]
drbd: Use DRBD_MINOR_COUNT_DEF in one more place

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
12 years agodrbd: Lower log priority for an event that is definitely not an error
Philipp Reisner [Wed, 25 May 2011 09:03:04 +0000 (11:03 +0200)]
drbd: Lower log priority for an event that is definitely not an error

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
12 years agodrbd: Don't use empty nested netlink attributes
Andreas Gruenbacher [Tue, 24 May 2011 12:18:31 +0000 (14:18 +0200)]
drbd: Don't use empty nested netlink attributes

Before mainline commit ea5693cc (v2.6.29-rc1), empty nested netlink attributes
were not allowed.  Fix that by leaving out nested attributes if they are empty
and by allowing the top-level attributes to be missing.

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
12 years agodrbd: drbd_adm_prepare(): Pass through error codes
Andreas Gruenbacher [Tue, 24 May 2011 12:17:08 +0000 (14:17 +0200)]
drbd: drbd_adm_prepare(): Pass through error codes

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
12 years agodrbd: drbd_nla_check_mandatory(): Need to remove the DRBD_GENLA_F_MANDATORY flag...
Andreas Gruenbacher [Tue, 24 May 2011 12:08:58 +0000 (14:08 +0200)]
drbd: drbd_nla_check_mandatory(): Need to remove the DRBD_GENLA_F_MANDATORY flag first

We need to remove the flag before checking for valid types.

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
12 years agodrbd: Make drbd's use of netlink attribute flags less confusing
Andreas Gruenbacher [Thu, 19 May 2011 15:39:28 +0000 (17:39 +0200)]
drbd: Make drbd's use of netlink attribute flags less confusing

Make it more clear in the flag names which flags are internal to drbd, and
which are not.

The check for mandatory attributes is the only extension visible at the netlink
layer.  Attributes with this flag set would look like unknown attributes to
some kernel versions.  The netlink layer would ignore them and also skip
consistency checks on the attribute type and legth.  To avoid this, we check
for mandatory attributes first, remove the mandatory flag, and then process the
attributes normally.

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
12 years agodrbd: Remove unused GENLA_F_MAY_IGNORE flag
Andreas Gruenbacher [Wed, 18 May 2011 14:48:16 +0000 (16:48 +0200)]
drbd: Remove unused GENLA_F_MAY_IGNORE flag

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
12 years agodrbd: Output signed / unsigned netlink fields correctly
Andreas Gruenbacher [Tue, 17 May 2011 11:29:46 +0000 (13:29 +0200)]
drbd: Output signed / unsigned netlink fields correctly

Note: All input values are still treated as signed; unsigned long long values
are still broken.

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
12 years agodrbd: Use more generic constant names
Andreas Gruenbacher [Thu, 12 May 2011 23:24:14 +0000 (01:24 +0200)]
drbd: Use more generic constant names

These constants are useful for the same purpose in more than one place.

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
12 years agodrbd: Send PROTOCOL_UPDATE packets when appropriate
Philipp Reisner [Mon, 16 May 2011 15:38:45 +0000 (17:38 +0200)]
drbd: Send PROTOCOL_UPDATE packets when appropriate

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
12 years agodrbd: Receiving part for the PROTOCOL_UPDATE packet
Philipp Reisner [Mon, 16 May 2011 15:38:11 +0000 (17:38 +0200)]
drbd: Receiving part for the PROTOCOL_UPDATE packet

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
12 years agodrbd: Allocation of int_dig_in and int_dig_vv was missing
Philipp Reisner [Tue, 17 May 2011 08:12:56 +0000 (10:12 +0200)]
drbd: Allocation of int_dig_in and int_dig_vv was missing

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
12 years agodrbd: Made cmp_after_sb() more generic into convert_after_sb()
Philipp Reisner [Mon, 16 May 2011 15:31:47 +0000 (17:31 +0200)]
drbd: Made cmp_after_sb() more generic into convert_after_sb()

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
12 years agodrbd: protect updates to integrits_tfm by tconn->data->mutex
Philipp Reisner [Mon, 16 May 2011 10:57:15 +0000 (12:57 +0200)]
drbd: protect updates to integrits_tfm by tconn->data->mutex

Since we need to hold that mutex anyways to make sure the peer
gets that change in the right position in the data stream,
it makes a lot of sense to use the same mutex to ensure existence
of the tfm.

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
12 years agodrbd: Refuse to change network options online when...
Philipp Reisner [Mon, 16 May 2011 12:30:24 +0000 (14:30 +0200)]
drbd: Refuse to change network options online when...

* the peer does not speak protocol_version 100 and the
  user wants to change one of:
    - wire_protocol
    - two_primaries
    - integrity_alg

* the user wants to remove the allow_two_primaries flag
  when there are two primaries

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
12 years agodrbd: Rename DISK_SIZE_SECT -> DISK_SIZE
Andreas Gruenbacher [Wed, 11 May 2011 12:44:55 +0000 (14:44 +0200)]
drbd: Rename DISK_SIZE_SECT -> DISK_SIZE

We don't have the units in constant names in other places, either.

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
12 years agodrbd: Convert resync-after into a signed netlink field
Andreas Gruenbacher [Thu, 12 May 2011 10:02:54 +0000 (12:02 +0200)]
drbd: Convert resync-after into a signed netlink field

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
12 years agodrbd: Fix the upper limit of resync-after
Andreas Gruenbacher [Thu, 12 May 2011 09:15:34 +0000 (11:15 +0200)]
drbd: Fix the upper limit of resync-after

The 32-bit resync_after netlink field takes a device minor number as
parameter, which is no longer limited to 255.  We cannot statically
verify which device numbers are valid, so set the ummer limit to the
highest possible signed 32-bit integer.

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>