firefly-linux-kernel-4.4.55.git
11 years agodrbd: Map from (connection, volume number) to device in the receive handlers
Andreas Gruenbacher [Fri, 25 Mar 2011 01:43:51 +0000 (02:43 +0100)]
drbd: Map from (connection, volume number) to device in the receive handlers

The receive handlers do not all handle unknown volume numbers the same
way.

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
11 years agodrbd: Pass struct packet_info down to the receive functions
Andreas Gruenbacher [Thu, 24 Mar 2011 23:57:38 +0000 (00:57 +0100)]
drbd: Pass struct packet_info down to the receive functions

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
11 years agodrbd: Remove useless error messages
Andreas Gruenbacher [Thu, 24 Mar 2011 23:35:45 +0000 (00:35 +0100)]
drbd: Remove useless error messages

These messages can only trigger in case there is a pretty obvious
internal programming error.

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
11 years agodrbd: A small cleanup in drbdd()
Andreas Gruenbacher [Thu, 24 Mar 2011 23:01:04 +0000 (00:01 +0100)]
drbd: A small cleanup in drbdd()

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
11 years agodrbd: _drbd_send_bitmap(): Use the pre-allocated send buffer
Andreas Gruenbacher [Thu, 24 Mar 2011 20:31:38 +0000 (21:31 +0100)]
drbd: _drbd_send_bitmap(): Use the pre-allocated send buffer

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
11 years agodrbd: Preallocate one page per drbd_socket as a send buffer
Andreas Gruenbacher [Thu, 24 Mar 2011 20:17:52 +0000 (21:17 +0100)]
drbd: Preallocate one page per drbd_socket as a send buffer

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
11 years agodrbd: receive_bitmap(): Use the pre-allocated receive buffer
Andreas Gruenbacher [Thu, 24 Mar 2011 20:23:50 +0000 (21:23 +0100)]
drbd: receive_bitmap(): Use the pre-allocated receive buffer

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
11 years agodrbd: Preallocate one page per drbd_socket as a receive buffer
Andreas Gruenbacher [Thu, 24 Mar 2011 17:07:54 +0000 (18:07 +0100)]
drbd: Preallocate one page per drbd_socket as a receive buffer

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
11 years agodrbd: Converted drbd_try_outdate_peer() from mdev to tconn
Philipp Reisner [Thu, 24 Mar 2011 10:03:07 +0000 (11:03 +0100)]
drbd: Converted drbd_try_outdate_peer() from mdev to tconn

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
11 years agodrbd: Rename the DCBP_* functions to dcbp_* and move them to where they are used
Andreas Gruenbacher [Tue, 22 Mar 2011 16:20:45 +0000 (17:20 +0100)]
drbd: Rename the DCBP_* functions to dcbp_* and move them to where they are used

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
11 years agodrbd: Make _drbd_send_bitmap() static
Andreas Gruenbacher [Tue, 22 Mar 2011 15:03:43 +0000 (16:03 +0100)]
drbd: Make _drbd_send_bitmap() static

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
11 years agodrbd: Move drbd_send_ping() and drbd_send_ping_ack() to drbd_main.c
Andreas Gruenbacher [Tue, 22 Mar 2011 09:55:48 +0000 (10:55 +0100)]
drbd: Move drbd_send_ping() and drbd_send_ping_ack() to drbd_main.c

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
11 years agodrbd: Always use the same protocol version for the same peer
Andreas Gruenbacher [Mon, 21 Mar 2011 13:10:15 +0000 (14:10 +0100)]
drbd: Always use the same protocol version for the same peer

There is no need to send protocol 80 headers to peers that understand
protocol 95 headers.  Make sure that we don't send protocol 95 headers
until we have agreed upon a protocol version with our peer, though.

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
11 years agodrbd: drbd_connected(): Return an error code upon failure.
Andreas Gruenbacher [Thu, 24 Mar 2011 13:31:22 +0000 (14:31 +0100)]
drbd: drbd_connected(): Return an error code upon failure.

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
11 years agodrbd: Introduce and use drbd_recv_all_warn()
Andreas Gruenbacher [Thu, 24 Mar 2011 02:28:04 +0000 (03:28 +0100)]
drbd: Introduce and use drbd_recv_all_warn()

The pattern of receiving a fixed number of bytes and warning if a short
packet is received and the receiver has not actively been interruped is
repeated many times; clean that up.

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
11 years agodrbd: Get rid of typedef drbd_work_cb
Andreas Gruenbacher [Tue, 21 Dec 2010 11:38:39 +0000 (12:38 +0100)]
drbd: Get rid of typedef drbd_work_cb

This type is not used anywhere else.

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
11 years agodrbd: Rename various functions from *_oos_* to *_out_of_sync_* for clarity
Andreas Gruenbacher [Sun, 19 Dec 2010 22:53:14 +0000 (23:53 +0100)]
drbd: Rename various functions from *_oos_* to *_out_of_sync_* for clarity

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
11 years agodrbd: drbd_may_do_local_read(): Use bool/true/false
Andreas Gruenbacher [Sun, 19 Dec 2010 19:48:29 +0000 (20:48 +0100)]
drbd: drbd_may_do_local_read(): Use bool/true/false

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
11 years agodrbd: Remove unnecessary assertion
Andreas Gruenbacher [Fri, 17 Dec 2010 22:08:33 +0000 (23:08 +0100)]
drbd: Remove unnecessary assertion

This is also checked further below in the same function.

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
11 years agodrbd: Remove duplicate initialization
Andreas Gruenbacher [Mon, 13 Dec 2010 21:50:15 +0000 (22:50 +0100)]
drbd: Remove duplicate initialization

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
11 years agodrbd: drbd_md_sync_page_io(): Return 0 upon success and an error code otherwise
Andreas Gruenbacher [Mon, 13 Dec 2010 01:25:41 +0000 (02:25 +0100)]
drbd: drbd_md_sync_page_io(): Return 0 upon success and an error code otherwise

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
11 years agodrbd: _drbd_md_sync_page_io(): Return 0 upon success and an error code otherwise
Andreas Gruenbacher [Mon, 13 Dec 2010 01:20:47 +0000 (02:20 +0100)]
drbd: _drbd_md_sync_page_io(): Return 0 upon success and an error code otherwise

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
11 years agodrbd: drbd_bm_read() never returns a positive value through drbd_bitmap_io()
Andreas Gruenbacher [Mon, 13 Dec 2010 00:44:11 +0000 (01:44 +0100)]
drbd: drbd_bm_read() never returns a positive value through drbd_bitmap_io()

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
11 years agodrbd: Make all command handlers return 0 upon success and an error code otherwise
Andreas Gruenbacher [Thu, 17 Mar 2011 11:10:19 +0000 (12:10 +0100)]
drbd: Make all command handlers return 0 upon success and an error code otherwise

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
11 years agodrbd: Add drbd_recv_all(): Receive an entire buffer
Andreas Gruenbacher [Thu, 17 Mar 2011 16:15:20 +0000 (17:15 +0100)]
drbd: Add drbd_recv_all(): Receive an entire buffer

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
11 years agodrbd: send_bitmap_rle_or_plain(): Error handling cleanup
Andreas Gruenbacher [Thu, 9 Dec 2010 23:45:25 +0000 (00:45 +0100)]
drbd: send_bitmap_rle_or_plain(): Error handling cleanup

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
11 years agodrbd: recv_resync_read(): Return 0 upon success and an error code otherwise
Andreas Gruenbacher [Wed, 16 Mar 2011 16:58:27 +0000 (17:58 +0100)]
drbd: recv_resync_read(): Return 0 upon success and an error code otherwise

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
11 years agodrbd: recv_dless_read(): Return 0 upon success and an error code otherwise
Andreas Gruenbacher [Wed, 16 Mar 2011 16:54:02 +0000 (17:54 +0100)]
drbd: recv_dless_read(): Return 0 upon success and an error code otherwise

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
11 years agodrbd: drbd_drain_block(): Return 0 upon success and an error code otherwise
Andreas Gruenbacher [Wed, 16 Mar 2011 16:50:50 +0000 (17:50 +0100)]
drbd: drbd_drain_block(): Return 0 upon success and an error code otherwise

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
11 years agodrbd: drbd_recv_header(): Return 0 upon success and an error code otherwise
Andreas Gruenbacher [Wed, 16 Mar 2011 16:31:52 +0000 (17:31 +0100)]
drbd: drbd_recv_header(): Return 0 upon success and an error code otherwise

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
11 years agodrbd: decode_header(): Return 0 upon success and an error code otherwise
Andreas Gruenbacher [Wed, 16 Mar 2011 16:22:39 +0000 (17:22 +0100)]
drbd: decode_header(): Return 0 upon success and an error code otherwise

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
11 years agodrbd: drbd_process_done_ee(): Return 0 upon success and an error code otherwise
Andreas Gruenbacher [Wed, 16 Mar 2011 16:16:12 +0000 (17:16 +0100)]
drbd: drbd_process_done_ee(): Return 0 upon success and an error code otherwise

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
11 years agodrbd: Make all worker callbacks return 0 upon success and an error code otherwise
Andreas Gruenbacher [Wed, 16 Mar 2011 14:31:39 +0000 (15:31 +0100)]
drbd: Make all worker callbacks return 0 upon success and an error code otherwise

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
11 years agodrbd: Temporarily change the return type of all worker callbacks
Andreas Gruenbacher [Wed, 16 Mar 2011 13:53:19 +0000 (14:53 +0100)]
drbd: Temporarily change the return type of all worker callbacks

This helps to ensure that we don't miss one of them when changing their
return value semantics.

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
11 years agodrbd: drbd_send_short_cmd(): Return 0 upon success and an error code otherwise
Andreas Gruenbacher [Wed, 16 Mar 2011 15:08:22 +0000 (16:08 +0100)]
drbd: drbd_send_short_cmd(): Return 0 upon success and an error code otherwise

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
11 years agodrbd: drbd_send_dblock(): Return 0 upon success and an error code otherwise
Andreas Gruenbacher [Wed, 16 Mar 2011 10:52:58 +0000 (11:52 +0100)]
drbd: drbd_send_dblock(): Return 0 upon success and an error code otherwise

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
11 years agodrbd: _drbd_send_bio(), _drbd_send_zc_bio(): Return 0 upon success and an error code...
Andreas Gruenbacher [Wed, 16 Mar 2011 10:46:33 +0000 (11:46 +0100)]
drbd: _drbd_send_bio(), _drbd_send_zc_bio(): Return 0 upon success and an error code otherwise

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
11 years agodrbd: drbd_send_block(): Return 0 upon success and an error code otherwise
Andreas Gruenbacher [Wed, 16 Mar 2011 10:35:20 +0000 (11:35 +0100)]
drbd: drbd_send_block(): Return 0 upon success and an error code otherwise

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
11 years agodrbd: _drbd_send_zc_ee(): Return 0 upon success and an error code otherwise
Andreas Gruenbacher [Wed, 16 Mar 2011 09:49:09 +0000 (10:49 +0100)]
drbd: _drbd_send_zc_ee(): Return 0 upon success and an error code otherwise

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
11 years agodrbd: _drbd_send_page(): Return 0 upon success and an error code otherwise
Andreas Gruenbacher [Wed, 16 Mar 2011 09:44:16 +0000 (10:44 +0100)]
drbd: _drbd_send_page(): Return 0 upon success and an error code otherwise

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
11 years agodrbd: _drbd_no_send_page(): Return 0 upon success and an error code otherwise
Andreas Gruenbacher [Wed, 16 Mar 2011 08:41:10 +0000 (09:41 +0100)]
drbd: _drbd_no_send_page(): Return 0 upon success and an error code otherwise

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
11 years agodrbd: drbd_send_oos(): Return 0 upon success and an error code otherwise
Andreas Gruenbacher [Wed, 16 Mar 2011 00:39:44 +0000 (01:39 +0100)]
drbd: drbd_send_oos(): Return 0 upon success and an error code otherwise

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
11 years agodrbd: drbd_send_drequest_csum(): Return 0 upon success and an error code otherwise
Andreas Gruenbacher [Wed, 16 Mar 2011 00:37:21 +0000 (01:37 +0100)]
drbd: drbd_send_drequest_csum(): Return 0 upon success and an error code otherwise

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
11 years agodrbd: drbd_send_drequest(): Return 0 upon success and an error code otherwise
Andreas Gruenbacher [Wed, 16 Mar 2011 00:34:24 +0000 (01:34 +0100)]
drbd: drbd_send_drequest(): Return 0 upon success and an error code otherwise

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
11 years agodrbd: drbd_send_ov_request(): Return 0 upon success and an error code otherwise
Andreas Gruenbacher [Wed, 16 Mar 2011 00:31:39 +0000 (01:31 +0100)]
drbd: drbd_send_ov_request(): Return 0 upon success and an error code otherwise

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
11 years agodrbd: drbd_send_ack_ex(): Return 0 upon success and an error code otherwise
Andreas Gruenbacher [Wed, 16 Mar 2011 00:31:39 +0000 (01:31 +0100)]
drbd: drbd_send_ack_ex(): Return 0 upon success and an error code otherwise

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
11 years agodrbd: drbd_send_ack_{dp,rp}(): Return void: the result is never used
Andreas Gruenbacher [Wed, 16 Mar 2011 00:30:14 +0000 (01:30 +0100)]
drbd: drbd_send_ack_{dp,rp}(): Return void: the result is never used

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
11 years agodrbd: drbd_send_ack(): Return 0 upon success and an error code otherwise
Andreas Gruenbacher [Wed, 16 Mar 2011 14:39:08 +0000 (15:39 +0100)]
drbd: drbd_send_ack(): Return 0 upon success and an error code otherwise

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
11 years agodrbd: _drbd_send_ack(): Return 0 upon success and an error code otherwise
Andreas Gruenbacher [Wed, 16 Mar 2011 00:27:22 +0000 (01:27 +0100)]
drbd: _drbd_send_ack(): Return 0 upon success and an error code otherwise

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
11 years agodrbd: drbd_send_b_ack(): Return void: the result is never used
Andreas Gruenbacher [Wed, 16 Mar 2011 00:25:28 +0000 (01:25 +0100)]
drbd: drbd_send_b_ack(): Return void: the result is never used

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
11 years agodrbd: drbd_send_sr_reply(): Return void: the result is never used
Andreas Gruenbacher [Wed, 16 Mar 2011 00:20:38 +0000 (01:20 +0100)]
drbd: drbd_send_sr_reply(): Return void: the result is never used

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
11 years agodrbd: drbd_send_state_req(): Return 0 upon success and an error code otherwise
Andreas Gruenbacher [Wed, 16 Mar 2011 00:19:27 +0000 (01:19 +0100)]
drbd: drbd_send_state_req(): Return 0 upon success and an error code otherwise

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
11 years agodrbd: conn_send_state_req(): Return 0 upon success and an error code otherwise
Andreas Gruenbacher [Wed, 16 Mar 2011 00:17:35 +0000 (01:17 +0100)]
drbd: conn_send_state_req(): Return 0 upon success and an error code otherwise

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
11 years agodrbd: _conn_send_state_req(): Return 0 upon success and an error code otherwise
Andreas Gruenbacher [Wed, 16 Mar 2011 00:16:25 +0000 (01:16 +0100)]
drbd: _conn_send_state_req(): Return 0 upon success and an error code otherwise

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
11 years agodrbd: drbd_send_sizes(): Return 0 upon success and an error code otherwise
Andreas Gruenbacher [Wed, 16 Mar 2011 00:12:50 +0000 (01:12 +0100)]
drbd: drbd_send_sizes(): Return 0 upon success and an error code otherwise

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
11 years agodrbd: drbd_gen_and_send_sync_uuid(): Return void: the result is never used
Andreas Gruenbacher [Wed, 16 Mar 2011 00:09:01 +0000 (01:09 +0100)]
drbd: drbd_gen_and_send_sync_uuid(): Return void: the result is never used

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
11 years agodrbd: drbd_send_uuids() and its variants: Return 0 upon success and an error code...
Andreas Gruenbacher [Wed, 16 Mar 2011 00:07:20 +0000 (01:07 +0100)]
drbd: drbd_send_uuids() and its variants: Return 0 upon success and an error code otherwise

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
11 years agodrbd: drbd_send_protocol(): Return 0 upon success and an error code otherwise
Andreas Gruenbacher [Wed, 16 Mar 2011 00:05:37 +0000 (01:05 +0100)]
drbd: drbd_send_protocol(): Return 0 upon success and an error code otherwise

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
11 years agodrbd: drbd_send_handshake(): Return 0 upon success and an error code otherwise
Andreas Gruenbacher [Tue, 15 Mar 2011 23:54:19 +0000 (00:54 +0100)]
drbd: drbd_send_handshake(): Return 0 upon success and an error code otherwise

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
11 years agodrbd: drbd_send_state(): Return 0 upon success and an error code otherwise
Andreas Gruenbacher [Tue, 15 Mar 2011 23:50:00 +0000 (00:50 +0100)]
drbd: drbd_send_state(): Return 0 upon success and an error code otherwise

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
11 years agodrbd: drbd_send_sync_param(): Return 0 upon success and an error code otherwise
Andreas Gruenbacher [Tue, 15 Mar 2011 23:43:02 +0000 (00:43 +0100)]
drbd: drbd_send_sync_param(): Return 0 upon success and an error code otherwise

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
11 years agodrbd: drbd_send_cmd(): Return 0 upon success and an error code otherwise
Andreas Gruenbacher [Tue, 15 Mar 2011 23:38:58 +0000 (00:38 +0100)]
drbd: drbd_send_cmd(): Return 0 upon success and an error code otherwise

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
11 years agodrbd: Get rid of USE_DATA_SOCKET and USE_META_SOCKET
Andreas Gruenbacher [Tue, 15 Mar 2011 23:11:25 +0000 (00:11 +0100)]
drbd: Get rid of USE_DATA_SOCKET and USE_META_SOCKET

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
11 years agodrbd: conn_send_cmd(): Return 0 upon success and an error code otherwise
Andreas Gruenbacher [Tue, 15 Mar 2011 22:55:59 +0000 (23:55 +0100)]
drbd: conn_send_cmd(): Return 0 upon success and an error code otherwise

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
11 years agodrbd: _drbd_send_cmd(): Return 0 upon success and an error code otherwise
Andreas Gruenbacher [Tue, 15 Mar 2011 22:51:21 +0000 (23:51 +0100)]
drbd: _drbd_send_cmd(): Return 0 upon success and an error code otherwise

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
11 years agodrbd: _conn_send_cmd(): Return 0 upon success and an error code otherwise
Andreas Gruenbacher [Tue, 15 Mar 2011 22:48:25 +0000 (23:48 +0100)]
drbd: _conn_send_cmd(): Return 0 upon success and an error code otherwise

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
11 years agodrbd: conn_send_cmd2(): Return 0 upon success and an error code otherwise
Andreas Gruenbacher [Tue, 15 Mar 2011 22:34:29 +0000 (23:34 +0100)]
drbd: conn_send_cmd2(): Return 0 upon success and an error code otherwise

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
11 years agodrbd: Add drbd_send_all(): Send an entire buffer
Andreas Gruenbacher [Wed, 15 Dec 2010 16:04:36 +0000 (17:04 +0100)]
drbd: Add drbd_send_all(): Send an entire buffer

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
11 years agodrbd: drbd_get_data_sock(): Return 0 upon success and an error code otherwise
Andreas Gruenbacher [Tue, 15 Mar 2011 15:15:10 +0000 (16:15 +0100)]
drbd: drbd_get_data_sock(): Return 0 upon success and an error code otherwise

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
11 years agodrbd: drbd_send(): Return a "real" error code if we have no socket
Andreas Gruenbacher [Thu, 9 Dec 2010 22:52:22 +0000 (23:52 +0100)]
drbd: drbd_send(): Return a "real" error code if we have no socket

Q: Can this case even trigger?  Is failing this way any better than one
that causes a NULL pointer access?

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
11 years agodrbd: Fixed conn_lowest_minor
Philipp Reisner [Tue, 22 Mar 2011 11:51:21 +0000 (12:51 +0100)]
drbd: Fixed conn_lowest_minor

It actually returned the lowest volume number. While doing that
renamed a few wrongly named variables.

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
11 years agodrbd: distribute former syncer_conf settings to disk, connection, and resource level
Lars Ellenberg [Wed, 23 Mar 2011 13:31:09 +0000 (14:31 +0100)]
drbd: distribute former syncer_conf settings to disk, connection, and resource level

This commit breaks the API again.

Move per-volume former syncer options into disk_conf.
Move per-connection former syncer options into net_conf.
Renamed the remainign sync_conf to res_opts

Syncer settings have been changeable at runtime, so we need to prepare
for these settings to be runtime-changeable in their new home as well.

Introduce new configuration operations, and share the netlink attribute
between "attach" (create new disk) and "disk-opts" (change options).
Same for "connect" and "net-opts".

Some fields cannot be changed at runtime, however.
Introduce a new flag GENLA_F_INVARIANT to be able to trigger on that in
the generated validation and assignment functions.

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
12 years agodrbd: conn_khelper() for user mode callbacks for connections
Philipp Reisner [Wed, 16 Mar 2011 16:39:12 +0000 (17:39 +0100)]
drbd: conn_khelper() for user mode callbacks for connections

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
12 years agodrbd: Allow volumes to become primary only on one side
Philipp Reisner [Wed, 16 Mar 2011 13:43:36 +0000 (14:43 +0100)]
drbd: Allow volumes to become primary only on one side

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
12 years agodrbd: fix conn_reconfig_start without conn_reconfig_done in drbd_adm_attach
Lars Ellenberg [Wed, 16 Mar 2011 15:52:10 +0000 (16:52 +0100)]
drbd: fix conn_reconfig_start without conn_reconfig_done in drbd_adm_attach

If drbd_adm_attach failed early, it left the CONFIG_PENDING bit on,
blocking any further conn_reconfig_start on that connection.

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
12 years agodrbd: Separate connection state changes from minor dev state changes #2
Philipp Reisner [Wed, 16 Mar 2011 10:27:48 +0000 (11:27 +0100)]
drbd: Separate connection state changes from minor dev state changes #2

New function got_conn_RqSReply()

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
12 years agodrbd: Converted got_Ping() and got_PingAck() from mdev to tconn
Philipp Reisner [Wed, 16 Mar 2011 10:21:50 +0000 (11:21 +0100)]
drbd: Converted got_Ping() and got_PingAck() 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: Allow packet handler functions that take a connection (meta connection)
Philipp Reisner [Wed, 16 Mar 2011 10:13:17 +0000 (11:13 +0100)]
drbd: Allow packet handler functions that take a connection (meta connection)

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
12 years agodrbd: Separate connection state changes from minor dev state changes #1
Philipp Reisner [Wed, 16 Mar 2011 09:55:07 +0000 (10:55 +0100)]
drbd: Separate connection state changes from minor dev state changes #1

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
12 years agodrbd: Converted receive_protocol() from mdev to tconn
Philipp Reisner [Tue, 15 Mar 2011 17:51:47 +0000 (18:51 +0100)]
drbd: Converted receive_protocol() 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: Allow packet handler functions that take a connection
Philipp Reisner [Tue, 15 Mar 2011 17:50:22 +0000 (18:50 +0100)]
drbd: Allow packet handler functions that take a connection

That is necessary in case a connection does not have a volume 0

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
12 years agodrbd: Moved CONN_DRY_RUN to the per connection (tconn) flags
Philipp Reisner [Tue, 15 Mar 2011 17:40:27 +0000 (18:40 +0100)]
drbd: Moved CONN_DRY_RUN to the per connection (tconn) flags

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
12 years agodrbd: Do not modify the connection state with something else that conn_request_state()
Philipp Reisner [Tue, 15 Mar 2011 17:24:49 +0000 (18:24 +0100)]
drbd: Do not modify the connection state with something else that conn_request_state()

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
12 years agodrbd: Allow two diskless minors to be connected
Philipp Reisner [Tue, 15 Mar 2011 16:27:47 +0000 (17:27 +0100)]
drbd: Allow two diskless minors to be connected

In the context of drbd-8.4 it no longer makes sense to
dissalow that.

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
12 years agodrbd: New minors have to intherit the connection state form their connection
Philipp Reisner [Tue, 15 Mar 2011 15:56:18 +0000 (16:56 +0100)]
drbd: New minors have to intherit the connection state form their connection

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
12 years agodrbd: process_done_ee() has to handle unconfigured devices now
Philipp Reisner [Tue, 15 Mar 2011 15:05:42 +0000 (16:05 +0100)]
drbd: process_done_ee() has to handle unconfigured devices now

Took the chance and converted tconn_process_done_ee() to use
idr_for_each_entry()

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
12 years agodrbd: Ignore packets for non existing volumes
Philipp Reisner [Tue, 15 Mar 2011 13:38:01 +0000 (14:38 +0100)]
drbd: Ignore packets for non existing volumes

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
12 years agodrbd: introduce in-kernel "down" command
Lars Ellenberg [Tue, 15 Mar 2011 15:26:37 +0000 (16:26 +0100)]
drbd: introduce in-kernel "down" command

This greatly simplifies deconfiguration of whole resources.

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
12 years agodrbd: add forgotten spin_unlock
Lars Ellenberg [Tue, 15 Mar 2011 15:04:09 +0000 (16:04 +0100)]
drbd: add forgotten spin_unlock

somehow a "goto abort" was introduced with commit
  drbd: Extracted is_valid_transition() out of sanitize_state()
which left drbd_req_state still holding the spin lock.

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
12 years agodrbd: bail out if a config requrest is over-determined, and not matching
Lars Ellenberg [Mon, 14 Mar 2011 12:58:03 +0000 (13:58 +0100)]
drbd: bail out if a config requrest is over-determined, and not matching

We have resources resp. connections, volumes, and minor numbers.
A config request may specifies all three of them.
If it turns out that the minor belongs to a different connection, or a
different volume number in the same connection, that configuration
request is invalid.

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
12 years agodrbd: new-connection and new-minor succeed, if the object already exists
Lars Ellenberg [Mon, 14 Mar 2011 12:22:35 +0000 (13:22 +0100)]
drbd: new-connection and new-minor succeed, if the object already exists

Follow O_CREAT semantics when creating connection or minor device/volume
objects.  If we need O_CREAT|O_EXCL semantics some time down the road,
we can add NLM_F_EXCL to the netlink message flags.

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
12 years agodrbd: Allow a Diskless Secondary volume to be removed
Lars Ellenberg [Thu, 10 Mar 2011 22:33:15 +0000 (23:33 +0100)]
drbd: Allow a Diskless Secondary volume to be removed

Even if the connection is still established.
We should be able to reduce a volume from a replication group,
without taking the whole group offline.

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
12 years agodrbd: simplify conn_all_vols_unconf, make it bool
Lars Ellenberg [Thu, 10 Mar 2011 22:28:13 +0000 (23:28 +0100)]
drbd: simplify conn_all_vols_unconf, make it bool

Get rid of a temporary variable and, funny bitand assignment.
Just short circuit, returning false, once we encounter the first
still configured volume.

FIXME verify call sites for need of rcu_read_lock or stronger.

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
12 years agodrbd: drbd_adm_get_status needs to show some more detail
Lars Ellenberg [Thu, 10 Mar 2011 21:18:18 +0000 (22:18 +0100)]
drbd: drbd_adm_get_status needs to show some more detail

We want to see existing connection objects, even if they do not
currently have volumes attached.

Change the .dumpit variant of drbd_adm_get_status to iterate not over
minor devices, but over connections + volumes.

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
12 years agodrbd: remove now unused connector related files
Lars Ellenberg [Mon, 7 Mar 2011 09:38:56 +0000 (10:38 +0100)]
drbd: remove now unused connector related files

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
12 years agodrbd: allow holes in minor and volume id allocation
Lars Ellenberg [Tue, 8 Mar 2011 15:11:16 +0000 (16:11 +0100)]
drbd: allow holes in minor and volume id allocation

s/idr_get_new/idr_get_new_above/

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
12 years agodrbd: switch configuration interface from connector to genetlink
Lars Ellenberg [Mon, 7 Mar 2011 11:49:34 +0000 (12:49 +0100)]
drbd: switch configuration interface from connector to genetlink

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
13 years agodrbd: prepare the transition from connector to genetlink
Lars Ellenberg [Mon, 7 Mar 2011 09:20:08 +0000 (10:20 +0100)]
drbd: prepare the transition from connector to genetlink

This adds the new API header and helper files.

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
13 years agodrbd: get rid of drbd_bcast_ee, it is of no use anymore
Lars Ellenberg [Mon, 7 Mar 2011 09:00:58 +0000 (10:00 +0100)]
drbd: get rid of drbd_bcast_ee, it is of no use anymore

This function was used to broadcast the (leading part of the)
bio payload in case we see a data integrity error.  It could be received
from userland with the drbdsetup events subcommand,
to have a peek into the payload that caused the checksum mismatch,
and guess from there what may have caused the mismatch,
mainly to guess wether it was modification of in-flight data,
or data corruption by broken hardware or software bugs.

Meanwhile we support bios that are larger than the maximum payload a
netlink datagram can carry.
And we have means to reliably detect modification of in-flight data by
calculating, and comparing, the checksum before and after sendmsg.
There is no need to carry this around anymore.

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
13 years agodrbd: fix drbd_delete_device: remove vnr from volumes; idr_remove(); synchronize_rcu...
Lars Ellenberg [Mon, 7 Mar 2011 08:49:02 +0000 (09:49 +0100)]
drbd: fix drbd_delete_device: remove vnr from volumes; idr_remove(); synchronize_rcu(); before cleanup

Still missing: rcu_readlock() on the various call sites that
access/iterate over those idrs.

We don't need a specific write lock, as we only modify from
configuration context, which is already strictly serialized.

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