Re: [PATCH] drbd: do not ignore signals in threads

2019-08-12 Thread Philipp Reisner
Hi David, [...] > While our code is 'out of tree' (you really don't want it - and since > it still uses force_sig() is fine) I suspect that the 'drdb' code > (with Christoph's allow_signal() patch) now loops in kernel if a user > sends it a signal. I am not asking for that out of tree code. But y

Re: [PATCH] drbd: do not ignore signals in threads

2019-08-12 Thread Philipp Reisner
Hi Jens, Please have a look. With fee109901f392 Eric W. Biederman changed drbd to use send_sig() instead of force_sig(). That was part of a series that did this change in multiple call sites tree wide. Which, by accident broke drbd, since the signals are _not_ allowed by default. That got relea

[PATCH 01/17] drbd: introduce drbd_recv_header_maybe_unplug

2017-08-28 Thread Philipp Reisner
n the backend of the receiving side, by increasing the chance of merging mergable requests, without trading latency for more throughput. Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_int.h | 5 +++- drivers/block/drbd/drbd_main.c | 13

Re: [PATCH 01/17] drbd: introduce drbd_recv_header_maybe_unplug

2017-08-28 Thread Philipp Reisner
Am Freitag, 25. August 2017, 19:26:20 CEST schrieb Jens Axboe: > On 08/24/2017 03:22 PM, Philipp Reisner wrote: > > +#ifndef blk_queue_plugged > > +struct drbd_plug_cb { > > + struct blk_plug_cb cb; > > + struct drbd_request *most_recent_req; > > + /* do we n

[PATCH 02/17] drbd: change list_for_each_safe to while(list_first_entry_or_null)

2017-08-24 Thread Philipp Reisner
From: Lars Ellenberg Two instances of list_for_each_safe can drop their tmp element, they really just peel off each element in turn from the start of the list. Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg diff --git a/drivers/block/drbd/drbd_req.c b/drivers/block/drbd

[PATCH 03/17] drbd: add explicit plugging when submitting batches

2017-08-24 Thread Philipp Reisner
From: Lars Ellenberg When submitting batches of requests which had been queued on the submitter thread, typically because they needed to wait for an activity log transactions, use explicit plugging to help potential merging of requests in the backend io-scheduler. Signed-off-by: Philipp Reisner

[PATCH 05/17] drbd: mark symbols static where possible

2017-08-24 Thread Philipp Reisner
tions with 'static'. Signed-off-by: Baoyou Xie Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c index a3b2ee7..11f3852 100644 --- a/drivers/block/drbd/drbd_main.c +++ b/drivers/bl

[PATCH 01/17] drbd: introduce drbd_recv_header_maybe_unplug

2017-08-24 Thread Philipp Reisner
n the backend of the receiving side, by increasing the chance of merging mergable requests, without trading latency for more throughput. Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg diff --git a/drivers/block/drbd/drbd_int.h b/drivers/block/drbd/drbd_int.h index 819f9d0..74a7d0b 1

[PATCH 06/17] drbd: Fix resource role for newly created resources in events2

2017-08-24 Thread Philipp Reisner
report R_SECONDARY for the newly created resource than R_UNKNOWN. I reviewd all call sites of conn_highest_role(), that change does not matter for the other call sites. Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg diff --git a/drivers/block/drbd/drbd_state.c b/drivers/block/drbd

[PATCH 09/17] drbd: Use setup_timer() instead of init_timer() to simplify the code.

2017-08-24 Thread Philipp Reisner
From: Geliang Tang Signed-off-by: Geliang Tang Signed-off-by: Roland Kammerer Signed-off-by: Philipp Reisner diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c index 11f3852..056d9ab 100644 --- a/drivers/block/drbd/drbd_main.c +++ b/drivers/block/drbd/drbd_main.c

[PATCH 10/17] drbd: fix rmmod cleanup, remove _all_ debugfs entries

2017-08-24 Thread Philipp Reisner
resources have been cleaned up. Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c index 056d9ab..8b8dd82 100644 --- a/drivers/block/drbd/drbd_main.c +++ b/drivers/block/drbd/drbd_main.c @@ -2420,7 +2420,6

[PATCH 08/17] drbd: fix potential get_ldev/put_ldev refcount imbalance during attach

2017-08-24 Thread Philipp Reisner
ne = 1; Impact of the bug was that the resulting refcount imbalance could lead to premature destruction of the object, potentially causing a NULL pointer dereference during a subsequent detach. Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg diff --git a/drivers/block/drbd/drbd_work

[PATCH 12/17] drbd: fix potential deadlock when trying to detach during handshake

2017-08-24 Thread Philipp Reisner
CS_INHIBIT_MD_IO, and move the call to drbd_md_get_buffer() inside the state_mutex grabbed in drbd_req_state(). Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg diff --git a/drivers/block/drbd/drbd_nl.c b/drivers/block/drbd/drbd_nl.c index c383b6c..6bb58a6 100644 --- a/drivers/bloc

[PATCH 07/17] drbd: new disk-option disable-write-same

2017-08-24 Thread Philipp Reisner
From: Lars Ellenberg Some backend devices claim to support write-same, but would fail actual write-same requests. Allow to set (or toggle) whether or not DRBD tries to support write-same. Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg diff --git a/drivers/block/drbd/drbd_nl.c

[PATCH 13/17] drbd: fix race between handshake and admin disconnect/down

2017-08-24 Thread Philipp Reisner
) early in _conn_request_state(), but became visible before conn_set_state() later in that call path, we could hit the BUG_ON() after _drbd_set_state(), because it returned SS_IN_TRANSIENT_STATE. To avoid that race, we better protect set_bit(SENT_STATE) with the spinlock. Signed-off-by: Philipp Reisner Signed-of

[PATCH 15/17] drbd: move global variables to drbd namespace and make some static

2017-08-24 Thread Philipp Reisner
From: Roland Kammerer This is a follow-up to Gregs complaints that drbd clutteres the global namespace. Some of DRBD's module parameters are only used within one compilation unit. Make these static. Signed-off-by: Roland Kammerer Signed-off-by: Philipp Reisner Signed-off-by: Lars Elle

[PATCH 11/17] drbd: A single dot should be put into a sequence.

2017-08-24 Thread Philipp Reisner
From: Markus Elfring Thus use the corresponding function "seq_putc". This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring Signed-off-by: Roland Kammerer Signed-off-by: Lars Ellenberg diff --git a/drivers/block/drbd/drbd_proc.c b/drivers/block/drbd/drbd_pro

[PATCH 16/17] drbd: abort drbd_start_resync if there is no connection

2017-08-24 Thread Philipp Reisner
From: Roland Kammerer This was found by a static analysis tool. While highly unlikely, be sure to return without dereferencing the NULL pointer. Reported-by: Shaobo Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg diff --git a/drivers/block/drbd/drbd_worker.c b/drivers/block

[PATCH 17/17] drbd: switch from kmalloc() to kmalloc_array()

2017-08-24 Thread Philipp Reisner
From: Roland Kammerer We had one call to kmalloc that actually allocates an array. Switch that one to the kmalloc_array() function. Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg diff --git a/drivers/block/drbd/drbd_receiver.c b/drivers/block/drbd/drbd_receiver.c index 4e8a543

[PATCH 14/17] drbd: rename "usermode_helper" to "drbd_usermode_helper"

2017-08-24 Thread Philipp Reisner
king error. Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg diff --git a/drivers/block/drbd/drbd_int.h b/drivers/block/drbd/drbd_int.h index 74a7d0b..61596af 100644 --- a/drivers/block/drbd/drbd_int.h +++ b/drivers/block/drbd/drbd_int.h @@ -75,7 +75,7 @@ extern int fault_rate;

[PATCH 00/17] DRBD updates

2017-08-24 Thread Philipp Reisner
nup, remove _all_ debugfs entries drbd: fix potential deadlock when trying to detach during handshake drbd: fix race between handshake and admin disconnect/down Markus Elfring (1): drbd: A single dot should be put into a sequence. Philipp Reisner (1): drbd: Fix resource role for newly cre

[PATCH 04/17] drbd: Send P_NEG_ACK upon write error in protocol != C

2017-08-24 Thread Philipp Reisner
e local node already. Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg diff --git a/drivers/block/drbd/drbd_worker.c b/drivers/block/drbd/drbd_worker.c index 2745db2..72cb0bd 100644 --- a/drivers/block/drbd/drbd_worker.c +++ b/drivers/block/drbd/drbd_worker.c @@ -1

Re: [PATCH] drbd: mark symbols static where possible

2016-09-02 Thread Philipp Reisner
Hi Baoyou, thanks for the patch. I applied it to our tree. Will be sent to one of the next merge windows... best regards, Phil Am Donnerstag, 1. September 2016, 18:57:53 CEST schrieb Baoyou Xie: > We get a few warnings when building kernel with W=1: > drivers/block/drbd/drbd_receiver.c:1224:6: w

[PATCH 07/30] drbd: adjust assert in w_bitmap_io to account for BM_LOCKED_CHANGE_ALLOWED

2016-06-13 Thread Philipp Reisner
From: Lars Ellenberg Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_main.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c index b0891c3..64e9525 100644 --- a

[PATCH 04/30] drbd: Implement handling of thinly provisioned storage on resync target nodes

2016-06-13 Thread Philipp Reisner
If during resync we read only zeroes for a range of sectors assume that these secotors can be discarded on the sync target node. Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_int.h | 5 +++ drivers/block/drbd/drbd_main.c | 18

[PATCH 08/30] drbd: fix regression: protocol A sometimes synchronous, C sometimes double-latency

2016-06-13 Thread Philipp Reisner
meta data). No impact if >= rtt passes between updates to the same block. Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_req.c | 18 +++--- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/drivers/block/drbd/drbd_req.c b/drive

[PATCH 27/30] drbd: get rid of empty statement in is_valid_state

2016-06-13 Thread Philipp Reisner
From: Roland Kammerer This should silence a warning about an empty statement. Thanks to Fabian Frederick who sent a patch I modified to be smaller and avoids an additional indent level. Signed-off-by: Roland Kammerer Signed-off-by: Philipp Reisner --- drivers/block/drbd/drbd_state.c | 3

[PATCH 28/30] drbd: finally report ms, not jiffies, in log message

2016-06-13 Thread Philipp Reisner
From: Lars Ellenberg Also skip the message unless bitmap IO took longer than 5 ms. Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_bitmap.c | 12 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/block/drbd

[PATCH 24/30] drbd: disallow promotion during resync handshake, avoid deadlock and hard reset

2016-06-13 Thread Philipp Reisner
000:: block drbd0: conn( WFSyncUUID -> SyncTarget ) *** ... after the resync handshake *** block drbd0: role( Secondary -> Primary ) Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_state.c | 9 +++

[PATCH 25/30] drbd: bump current uuid when resuming IO with diskless peer

2016-06-13 Thread Philipp Reisner
lures, because we now have diverging data without being able to recognize it. Make sure we also bump the current data generation UUID, if we notice "peer disk unknown" -> "peer disk known bad". Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/

[PATCH 26/30] drbd: code cleanups without semantic changes

2016-06-13 Thread Philipp Reisner
From: Fabian Frederick This contains various cosmetic fixes ranging from simple typos to const-ifying, and using booleans properly. Original commit messages from Fabian's patch set: drbd: debugfs: constify drbd_version_fops drbd: use seq_put instead of seq_print where possible drbd: include linu

[PATCH 22/30] drbd: introduce WRITE_SAME support

2016-06-13 Thread Philipp Reisner
do not support WRITE_SAME, by open-coding a submit loop. But not yet. Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_actlog.c | 9 ++- drivers/block/drbd/drbd_debugfs.c | 11 +-- drivers/block/drbd/drbd_int.h | 13 ++-- drivers/block/drbd

[PATCH 11/30] drbd: when receiving P_TRIM, zero-out partial unaligned chunks

2016-06-13 Thread Philipp Reisner
viour, and suddenly cause fstrim on thin-provisioned LVs to run out-of-space, instead of freeing up space, the default value is "yes". Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_int.h | 2 +- drivers/block/drbd/drbd_nl.c |

[PATCH 06/30] drbd: Create the protocol feature THIN_RESYNC

2016-06-13 Thread Philipp Reisner
If thinly provisioned volumes are used, during a resync the sync source tries to find out if a block is deallocated. If it is deallocated, then the resync target uses block_dev_issue_zeroout() on the range in question. Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers

[PATCH 10/30] drbd: allow parallel flushes for multi-volume resources

2016-06-13 Thread Philipp Reisner
parallel, then wait for all completions, to reduce worst-case latencies on multi-volume resources. Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_receiver.c | 114 + 1 file changed, 89 insertions(+), 25 deletions

[PATCH 05/30] drbd: Introduce new disk config option rs-discard-granularity

2016-06-13 Thread Philipp Reisner
As long as the value is 0 the feature is disabled. With setting it to a positive value, DRBD limits and aligns its resync requests to the rs-discard-granularity setting. If the sync source detects all zeros in such a block, the resync target discards the range on disk. Signed-off-by: Philipp

[PATCH 09/30] drbd: fix for truncated minor number in callback command line

2016-06-13 Thread Philipp Reisner
From: Lars Ellenberg The command line parameter the kernel module uses to communicate the device minor to userland helper is flawed in a way that the device indentifier "minor-%d" is being truncated to minors with a maximum of 5 digits. But DRBD 8.4 allows 2^20 == 1048576 minors, thus a minimum

[PATCH 12/30] drbd: possibly disable discard support, if backend has discard_zeroes_data=0

2016-06-13 Thread Philipp Reisner
protocol level. Otherwise, it would either discard, or do a fallback to zero-out, depending on its backend and configuration. * our local backend does not support discards, or (discard_zeroes_data=0 AND discard_zeroes_if_aligned=no). Signed-off-by: Philipp Reisner Signed-off-by: Lars

[PATCH 02/30] drbd: change bitmap write-out when leaving resync states

2016-06-13 Thread Philipp Reisner
write-out from after_state_ch(). The bitmap write-out for resync -> ahead/behind was missing completely before. Note that this is all only an optimization to avoid double-resyncs of already completed blocks in case this node crashes. Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenb

[PATCH 03/30] drbd: Kill code duplication

2016-06-13 Thread Philipp Reisner
Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_nl.c | 18 ++ 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/drivers/block/drbd/drbd_nl.c b/drivers/block/drbd/drbd_nl.c index 0bac9c8..fad03e4 100644 --- a/drivers/block

[PATCH 01/30] drbd: bitmap bulk IO: do not always suspend IO

2016-06-13 Thread Philipp Reisner
From: Lars Ellenberg The intention was to only suspend IO if some normal bitmap operation is supposed to be locked out, not always. If the bulk operation is flaged as BM_LOCKED_CHANGE_ALLOWED, we do not need to suspend IO. Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg

[PATCH 23/30] drbd: sync_handshake: handle identical uuids with current (frozen) Primary

2016-06-13 Thread Philipp Reisner
ced DRBD_FF_WSAME to determine if rule_nr = 41 can be applied. Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_receiver.c | 47 +++--- 1 file changed, 44 insertions(+), 3 deletions(-) diff --git a/drivers/block/drbd/drbd_r

[PATCH 18/30] drbd: if there is no good data accessible, writes should be IO errors

2016-06-13 Thread Philipp Reisner
ay to avoid these situations in the first place is to set OND_SUSPEND_IO, or even do a hard-reset from the pri-on-incon-degr policy helper hook. Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_req.c | 22 ++ 1 file changed, 22 inserti

[PATCH 19/30] drbd: only restart frozen disk io when D_UP_TO_DATE

2016-06-13 Thread Philipp Reisner
From: Lars Ellenberg When re-attaching the local backend device to a C_STANDALONE D_DISKLESS R_PRIMARY with OND_SUSPEND_IO, we may only resume IO if we recognize the backend that is being attached as D_UP_TO_DATE. Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block

[PATCH 13/30] drbd: zero-out partial unaligned discards on local backend

2016-06-13 Thread Philipp Reisner
From: Lars Ellenberg For consistency, also zero-out partial unaligned chunks of discard requests on the local backend. Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_int.h | 2 ++ drivers/block/drbd/drbd_req.c | 29 +++-- 2

[PATCH 20/30] drbd: discard_zeroes_if_aligned allows "thin" resync for discard_zeroes_data=0

2016-06-13 Thread Philipp Reisner
From: Lars Ellenberg Even if discard_zeroes_data != 0, if discard_zeroes_if_aligned is set, we assume we can reliably zero-out/discard using the drbd_issue_peer_discard() helper. Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_nl.c | 9 ++--- 1

[PATCH 15/30] drbd: finish resync on sync source only by notification from sync target

2016-06-13 Thread Philipp Reisner
ate change notification from the sync target. Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_actlog.c | 16 drivers/block/drbd/drbd_int.h| 19 ++- 2 files changed, 26 insertions(+), 9 deletions(-) diff --git a/drivers/

[PATCH 14/30] drbd: allow larger max_discard_sectors

2016-06-13 Thread Philipp Reisner
From: Lars Ellenberg Make sure we have at least 67 (> AL_UPDATES_PER_TRANSACTION) al-extents available, and allow up to half of that to be discarded in one bio. Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_actlog.c | 2 +- drivers/block/d

[PATCH 21/30] drbd: report sizes if rejecting too small peer disk

2016-06-13 Thread Philipp Reisner
From: Lars Ellenberg Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_receiver.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/block/drbd/drbd_receiver.c b/drivers/block/drbd/drbd_receiver.c index cb80fb4..367b8e9

[PATCH 16/30] drbd: introduce unfence-peer handler

2016-06-13 Thread Philipp Reisner
to be the node that previously called "fence", the node that is currently allowed to be Primary, and thus the only node that could trigger a new "fence" that could race with this unfence. Which makes us not need any cluster wide synchronization here, serializing two scripts run

[PATCH 29/30] drbd: al_write_transaction: skip re-scanning of bitmap page pointer array

2016-06-13 Thread Philipp Reisner
, remember the index numbers of the few affected pages, and later only re-check those to skip duplicates and unchanged ones. Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_actlog.c | 2 ++ drivers/block/drbd/drbd_bit

[PATCH 30/30] drbd: correctly handle failed crypto_alloc_hash

2016-06-13 Thread Philipp Reisner
From: Lars Ellenberg crypto_alloc_hash returns an ERR_PTR(), not NULL. Also reset peer_integrity_tfm to NULL, to not call crypto_free_hash() on an errno in the cleanup path. Reported-by: Insu Yun Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/drbd

[PATCH 17/30] drbd: don't forget error completion when "unsuspending" IO

2016-06-13 Thread Philipp Reisner
possible race with a new handshake (network hickup), we may be able to re-send requests, and can avoid passing IO errors up the stack. Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_nl.c | 48 +--- 1 file changed, 32

Re: [PATCH 00/30] DRBD updates

2016-06-13 Thread Philipp Reisner
in log message drbd: al_write_transaction: skip re-scanning of bitmap page pointer array drbd: correctly handle failed crypto_alloc_hash Philipp Reisner (4): drbd: Kill code duplication drbd: Implement handling of thinly provisioned storage on resync target nodes drbd: Introduce

[PATCH 10/30] drbd: allow parallel flushes for multi-volume resources

2016-06-13 Thread Philipp Reisner
parallel, then wait for all completions, to reduce worst-case latencies on multi-volume resources. Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_receiver.c | 113 + 1 file changed, 88 insertions(+), 25 deletions

[PATCH 07/30] drbd: adjust assert in w_bitmap_io to account for BM_LOCKED_CHANGE_ALLOWED

2016-06-13 Thread Philipp Reisner
From: Lars Ellenberg Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_main.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c index dd2432e..782e430 100644 --- a

[PATCH 28/30] drbd: finally report ms, not jiffies, in log message

2016-06-13 Thread Philipp Reisner
From: Lars Ellenberg Also skip the message unless bitmap IO took longer than 5 ms. Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_bitmap.c | 12 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/block/drbd

[PATCH 22/30] drbd: introduce WRITE_SAME support

2016-06-13 Thread Philipp Reisner
do not support WRITE_SAME, by open-coding a submit loop. But not yet. Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_actlog.c | 9 ++- drivers/block/drbd/drbd_debugfs.c | 11 +-- drivers/block/drbd/drbd_int.h | 13 ++-- drivers/block/drbd

[PATCH 24/30] drbd: disallow promotion during resync handshake, avoid deadlock and hard reset

2016-06-13 Thread Philipp Reisner
000:: block drbd0: conn( WFSyncUUID -> SyncTarget ) *** ... after the resync handshake *** block drbd0: role( Secondary -> Primary ) Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_state.c | 9 +++

[PATCH 18/30] drbd: if there is no good data accessible, writes should be IO errors

2016-06-13 Thread Philipp Reisner
ay to avoid these situations in the first place is to set OND_SUSPEND_IO, or even do a hard-reset from the pri-on-incon-degr policy helper hook. Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_req.c | 22 ++ 1 file changed, 22 inserti

[PATCH 06/30] drbd: Create the protocol feature THIN_RESYNC

2016-06-13 Thread Philipp Reisner
If thinly provisioned volumes are used, during a resync the sync source tries to find out if a block is deallocated. If it is deallocated, then the resync target uses block_dev_issue_zeroout() on the range in question. Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers

[PATCH 26/30] drbd: code cleanups without semantic changes

2016-06-13 Thread Philipp Reisner
From: Fabian Frederick This contains various cosmetic fixes ranging from simple typos to const-ifying, and using booleans properly. Original commit messages from Fabian's patch set: drbd: debugfs: constify drbd_version_fops drbd: use seq_put instead of seq_print where possible drbd: include linu

[PATCH 11/30] drbd: when receiving P_TRIM, zero-out partial unaligned chunks

2016-06-13 Thread Philipp Reisner
viour, and suddenly cause fstrim on thin-provisioned LVs to run out-of-space, instead of freeing up space, the default value is "yes". Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_int.h | 2 +- drivers/block/drbd/drbd_nl.c |

[PATCH 00/30] DRBD updates

2016-06-13 Thread Philipp Reisner
pointer array drbd: correctly handle failed crypto_alloc_hash Philipp Reisner (4): drbd: Kill code duplication drbd: Implement handling of thinly provisioned storage on resync target nodes drbd: Introduce new disk config option rs-discard-granularity drbd: Create the protocol feature THI

[PATCH 04/30] drbd: Implement handling of thinly provisioned storage on resync target nodes

2016-06-13 Thread Philipp Reisner
If during resync we read only zeroes for a range of sectors assume that these secotors can be discarded on the sync target node. Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_int.h | 5 +++ drivers/block/drbd/drbd_main.c | 18

[PATCH 05/30] drbd: Introduce new disk config option rs-discard-granularity

2016-06-13 Thread Philipp Reisner
As long as the value is 0 the feature is disabled. With setting it to a positive value, DRBD limits and aligns its resync requests to the rs-discard-granularity setting. If the sync source detects all zeros in such a block, the resync target discards the range on disk. Signed-off-by: Philipp

[PATCH 03/30] drbd: Kill code duplication

2016-06-13 Thread Philipp Reisner
Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_nl.c | 18 ++ 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/drivers/block/drbd/drbd_nl.c b/drivers/block/drbd/drbd_nl.c index 0bac9c8..fad03e4 100644 --- a/drivers/block

[PATCH 25/30] drbd: bump current uuid when resuming IO with diskless peer

2016-06-13 Thread Philipp Reisner
lures, because we now have diverging data without being able to recognize it. Make sure we also bump the current data generation UUID, if we notice "peer disk unknown" -> "peer disk known bad". Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/

[PATCH 12/30] drbd: possibly disable discard support, if backend has discard_zeroes_data=0

2016-06-13 Thread Philipp Reisner
protocol level. Otherwise, it would either discard, or do a fallback to zero-out, depending on its backend and configuration. * our local backend does not support discards, or (discard_zeroes_data=0 AND discard_zeroes_if_aligned=no). Signed-off-by: Philipp Reisner Signed-off-by: Lars

[PATCH 14/30] drbd: allow larger max_discard_sectors

2016-06-13 Thread Philipp Reisner
From: Lars Ellenberg Make sure we have at least 67 (> AL_UPDATES_PER_TRANSACTION) al-extents available, and allow up to half of that to be discarded in one bio. Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_actlog.c | 2 +- drivers/block/d

[PATCH 13/30] drbd: zero-out partial unaligned discards on local backend

2016-06-13 Thread Philipp Reisner
From: Lars Ellenberg For consistency, also zero-out partial unaligned chunks of discard requests on the local backend. Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_int.h | 2 ++ drivers/block/drbd/drbd_req.c | 29 +++-- 2

[PATCH 17/30] drbd: don't forget error completion when "unsuspending" IO

2016-06-13 Thread Philipp Reisner
possible race with a new handshake (network hickup), we may be able to re-send requests, and can avoid passing IO errors up the stack. Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_nl.c | 48 +--- 1 file changed, 32

[PATCH 02/30] drbd: change bitmap write-out when leaving resync states

2016-06-13 Thread Philipp Reisner
write-out from after_state_ch(). The bitmap write-out for resync -> ahead/behind was missing completely before. Note that this is all only an optimization to avoid double-resyncs of already completed blocks in case this node crashes. Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenb

[PATCH 09/30] drbd: fix for truncated minor number in callback command line

2016-06-13 Thread Philipp Reisner
From: Lars Ellenberg The command line parameter the kernel module uses to communicate the device minor to userland helper is flawed in a way that the device indentifier "minor-%d" is being truncated to minors with a maximum of 5 digits. But DRBD 8.4 allows 2^20 == 1048576 minors, thus a minimum

[PATCH 08/30] drbd: fix regression: protocol A sometimes synchronous, C sometimes double-latency

2016-06-13 Thread Philipp Reisner
meta data). No impact if >= rtt passes between updates to the same block. Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_req.c | 18 +++--- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/drivers/block/drbd/drbd_req.c b/drive

[PATCH 30/30] drbd: correctly handle failed crypto_alloc_hash

2016-06-13 Thread Philipp Reisner
From: Lars Ellenberg crypto_alloc_hash returns an ERR_PTR(), not NULL. Also reset peer_integrity_tfm to NULL, to not call crypto_free_hash() on an errno in the cleanup path. Reported-by: Insu Yun Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/drbd

[PATCH 21/30] drbd: report sizes if rejecting too small peer disk

2016-06-13 Thread Philipp Reisner
From: Lars Ellenberg Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_receiver.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/block/drbd/drbd_receiver.c b/drivers/block/drbd/drbd_receiver.c index 078c4d98

[PATCH 16/30] drbd: introduce unfence-peer handler

2016-06-13 Thread Philipp Reisner
to be the node that previously called "fence", the node that is currently allowed to be Primary, and thus the only node that could trigger a new "fence" that could race with this unfence. Which makes us not need any cluster wide synchronization here, serializing two scripts run

[PATCH 15/30] drbd: finish resync on sync source only by notification from sync target

2016-06-13 Thread Philipp Reisner
ate change notification from the sync target. Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_actlog.c | 16 drivers/block/drbd/drbd_int.h| 19 ++- 2 files changed, 26 insertions(+), 9 deletions(-) diff --git a/drivers/

[PATCH 01/30] drbd: bitmap bulk IO: do not always suspend IO

2016-06-13 Thread Philipp Reisner
From: Lars Ellenberg The intention was to only suspend IO if some normal bitmap operation is supposed to be locked out, not always. If the bulk operation is flaged as BM_LOCKED_CHANGE_ALLOWED, we do not need to suspend IO. Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg

[PATCH 23/30] drbd: sync_handshake: handle identical uuids with current (frozen) Primary

2016-06-13 Thread Philipp Reisner
ced DRBD_FF_WSAME to determine if rule_nr = 41 can be applied. Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_receiver.c | 47 +++--- 1 file changed, 44 insertions(+), 3 deletions(-) diff --git a/drivers/block/drbd/drbd_r

[PATCH 27/30] drbd: get rid of empty statement in is_valid_state

2016-06-13 Thread Philipp Reisner
From: Roland Kammerer This should silence a warning about an empty statement. Thanks to Fabian Frederick who sent a patch I modified to be smaller and avoids an additional indent level. Signed-off-by: Roland Kammerer Signed-off-by: Philipp Reisner --- drivers/block/drbd/drbd_state.c | 3

[PATCH 20/30] drbd: discard_zeroes_if_aligned allows "thin" resync for discard_zeroes_data=0

2016-06-13 Thread Philipp Reisner
From: Lars Ellenberg Even if discard_zeroes_data != 0, if discard_zeroes_if_aligned is set, we assume we can reliably zero-out/discard using the drbd_issue_peer_discard() helper. Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_nl.c | 9 ++--- 1

[PATCH 19/30] drbd: only restart frozen disk io when D_UP_TO_DATE

2016-06-13 Thread Philipp Reisner
From: Lars Ellenberg When re-attaching the local backend device to a C_STANDALONE D_DISKLESS R_PRIMARY with OND_SUSPEND_IO, we may only resume IO if we recognize the backend that is being attached as D_UP_TO_DATE. Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block

[PATCH 29/30] drbd: al_write_transaction: skip re-scanning of bitmap page pointer array

2016-06-13 Thread Philipp Reisner
, remember the index numbers of the few affected pages, and later only re-check those to skip duplicates and unchanged ones. Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_actlog.c | 2 ++ drivers/block/drbd/drbd_bit

Re: [Drbd-dev] [PATCH 05/30] drbd: Introduce new disk config option rs-discard-granularity

2016-04-25 Thread Philipp Reisner
Am Montag, 25. April 2016, 11:48:30 schrieb Bart Van Assche: > On 04/25/2016 09:42 AM, Philipp Reisner wrote: > > Am Montag, 25. April 2016, 08:35:26 schrieb Bart Van Assche: > >> On 04/25/2016 05:10 AM, Philipp Reisner wrote: > >>> As long as the value is 0 the fea

Re: [Drbd-dev] [PATCH 05/30] drbd: Introduce new disk config option rs-discard-granularity

2016-04-25 Thread Philipp Reisner
Am Montag, 25. April 2016, 08:35:26 schrieb Bart Van Assche: > On 04/25/2016 05:10 AM, Philipp Reisner wrote: > > As long as the value is 0 the feature is disabled. With setting > > it to a positive value, DRBD limits and aligns its resync requests > > to the rs-discard-granul

Re: [Drbd-dev] [PATCH 04/30] drbd: Implement handling of thinly provisioned storage on resync target nodes

2016-04-25 Thread Philipp Reisner
Am Montag, 25. April 2016, 08:28:45 schrieb Bart Van Assche: > On 04/25/2016 05:10 AM, Philipp Reisner wrote: > > If during resync we read only zeroes for a range of sectors assume > > that these secotors can be discarded on the sync target node. > > Hello Phil, > >

[PATCH 24/30] drbd: disallow promotion during resync handshake, avoid deadlock and hard reset

2016-04-25 Thread Philipp Reisner
000:: block drbd0: conn( WFSyncUUID -> SyncTarget ) *** ... after the resync handshake *** block drbd0: role( Secondary -> Primary ) Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_state.c | 9 +++

[PATCH 29/30] drbd: al_write_transaction: skip re-scanning of bitmap page pointer array

2016-04-25 Thread Philipp Reisner
, remember the index numbers of the few affected pages, and later only re-check those to skip duplicates and unchanged ones. Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_actlog.c | 2 ++ drivers/block/drbd/drbd_bit

[PATCH 17/30] drbd: don't forget error completion when "unsuspending" IO

2016-04-25 Thread Philipp Reisner
possible race with a new handshake (network hickup), we may be able to re-send requests, and can avoid passing IO errors up the stack. Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_nl.c | 48 +--- 1 file changed, 32

[PATCH 04/30] drbd: Implement handling of thinly provisioned storage on resync target nodes

2016-04-25 Thread Philipp Reisner
If during resync we read only zeroes for a range of sectors assume that these secotors can be discarded on the sync target node. Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_int.h | 5 +++ drivers/block/drbd/drbd_main.c | 18

[PATCH 15/30] drbd: finish resync on sync source only by notification from sync target

2016-04-25 Thread Philipp Reisner
ate change notification from the sync target. Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_actlog.c | 16 drivers/block/drbd/drbd_int.h| 19 ++- 2 files changed, 26 insertions(+), 9 deletions(-) diff --git a/drivers/

[PATCH 11/30] drbd: when receiving P_TRIM, zero-out partial unaligned chunks

2016-04-25 Thread Philipp Reisner
viour, and suddenly cause fstrim on thin-provisioned LVs to run out-of-space, instead of freeing up space, the default value is "yes". Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_int.h | 2 +- drivers/block/drbd/drbd_nl.c |

[PATCH 00/30] DBRD updates

2016-04-25 Thread Philipp Reisner
itmap page pointer array drbd: correctly handle failed crypto_alloc_hash Philipp Reisner (4): drbd: Kill code duplication drbd: Implement handling of thinly provisioned storage on resync target nodes drbd: Introduce new disk config option rs-discard-granularity drbd: Create the p

[PATCH 21/30] drbd: report sizes if rejecting too small peer disk

2016-04-25 Thread Philipp Reisner
From: Lars Ellenberg Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_receiver.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/block/drbd/drbd_receiver.c b/drivers/block/drbd/drbd_receiver.c index 078c4d98

[PATCH 30/30] drbd: correctly handle failed crypto_alloc_hash

2016-04-25 Thread Philipp Reisner
From: Lars Ellenberg crypto_alloc_hash returns an ERR_PTR(), not NULL. Also reset peer_integrity_tfm to NULL, to not call crypto_free_hash() on an errno in the cleanup path. Reported-by: Insu Yun Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/drbd

[PATCH 22/30] drbd: introduce WRITE_SAME support

2016-04-25 Thread Philipp Reisner
do not support WRITE_SAME, by open-coding a submit loop. But not yet. Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_actlog.c | 9 ++- drivers/block/drbd/drbd_debugfs.c | 11 +-- drivers/block/drbd/drbd_int.h | 13 ++-- drivers/block/drbd

[PATCH 28/30] drbd: finally report ms, not jiffies, in log message

2016-04-25 Thread Philipp Reisner
From: Lars Ellenberg Also skip the message unless bitmap IO took longer than 5 ms. Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_bitmap.c | 12 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/block/drbd

[PATCH 02/30] drbd: change bitmap write-out when leaving resync states

2016-04-25 Thread Philipp Reisner
write-out from after_state_ch(). The bitmap write-out for resync -> ahead/behind was missing completely before. Note that this is all only an optimization to avoid double-resyncs of already completed blocks in case this node crashes. Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenb

  1   2   3   4   5   >