[PATCH 32/38] drbd: don't block forever in disconnect during resync if fencing=r-a-stonith

2015-11-25 Thread Philipp Reisner
writeout in this case does not care for concurrent application IO, so there is no point waiting for it. Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/block/drbd

[PATCH 35/38] drbd: make suspend_io() / resume_io() must be thread and recursion safe

2015-11-25 Thread Philipp Reisner
Avoid to prematurely resume application IO: don't set/clear a single bit, but inc/dec an atomic counter. Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_int.h | 4 ++-- drivers/block/drbd/drbd_nl.c| 8 +--- drivers/block/drbd/drbd_state.

[PATCH 08/38] drbd: Backport the "events2" command

2015-11-25 Thread Philipp Reisner
user-base for a later switch to the complete drbd9 code base. Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_int.h | 45 +++ drivers/block/drbd/drbd_nl.c | 625 - drivers/block/drbd/drbd_receiver.c

[PATCH 12/38] drbd: Fix spurious disk-timeout

2015-11-25 Thread Philipp Reisner
timer looks at a new request with timestamp still zero (before it even was submitted), and 0 + timeout is most likely older than "now". Better assign the timestamp right when we put the request object on said ring list. Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --

[PATCH 20/38] drbd: fix refcount error during detach of an already failed disk

2015-11-25 Thread Philipp Reisner
sive local disk still pending. In that case, drbd_md_get_buffer() will return NULL. Don't unconditionally call drbd_md_put_buffer(), or it will cause refcount imbalance, and prevent any further re-attach on this volume (until it is deleted and re-created). Signed-off-by: Philipp Reisner Sign

[PATCH 06/38] drbd: drbd_adm_attach(): Add missing drbd_resync_after_changed()

2015-11-25 Thread Philipp Reisner
From: Andreas Gruenbacher Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_nl.c | 28 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/drivers/block/drbd/drbd_nl.c b/drivers/block/drbd/drbd_nl.c index dfc1799

[PATCH 18/38] drbd: improve network timeout detection

2015-11-25 Thread Philipp Reisner
From: Lars Ellenberg Don't blame the peer for being unresponsive, if we did not even ask the question yet. Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_int.h| 2 + drivers/block/drbd/drbd_req.c

[PATCH 01/38] MAINTAINERS: Updated information for DRBD DRIVER

2015-11-25 Thread Philipp Reisner
-git a/MAINTAINERS b/MAINTAINERS index 050d0e7..2ea2604 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -3592,13 +3592,12 @@ F: drivers/scsi/dpt* F: drivers/scsi/dpt/ DRBD DRIVER -P: Philipp Reisner -P: Lars Ellenberg -M: drbd-...@lists.linbit.com -L: drbd-u...@lists.linbit.com +M:

[PATCH 09/38] drbd: Backport the "status" command

2015-11-25 Thread Philipp Reisner
information is exposed through /proc/drbd. Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_nl.c | 566 +-- include/linux/drbd_genl.h| 35 +++ include/linux/idr.h | 14 ++ 3 files changed, 536 insertions

[PATCH 21/38] drbd: Rename asender to ack_receiver

2015-11-25 Thread Philipp Reisner
This prepares the next patch where the sending on the meta (or control) socket is moved to a dedicated workqueue. Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_int.h | 6 +++--- drivers/block/drbd/drbd_main.c | 10 +- drivers/block

[PATCH 19/38] drbd: fix NULL deref in remember_new_state

2015-11-25 Thread Philipp Reisner
fine, there will be no change then. Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_state.c | 46 + 1 file changed, 14 insertions(+), 32 deletions(-) diff --git a/drivers/block/drbd/drbd_state.c b/drivers/block/drbd/

[PATCH 00/38] DRBD update

2015-11-25 Thread Philipp Reisner
(1): drbd: Deletion of an unnecessary check before the function call "lc_destroy" Oleg Drokin (1): drbd: fix memory leak in drbd_adm_resize Philipp Reisner (5): drbd: Remove pointless check drbd: Replace 0 with the more meaningful GFP_NOWAIT drbd: Rename asender to ack_re

[PATCH 27/38] drbd: use bitmap_weight() helper, don't open code

2015-11-25 Thread Philipp Reisner
From: Lars Ellenberg Suggested by Akinobu Mita Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_bitmap.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/block/drbd/drbd_bitmap.c b/drivers/block/drbd

[PATCH 29/38] drbd: fix queue limit setup for discard

2015-11-25 Thread Philipp Reisner
usion with e.g. lsblk -D. Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_nl.c | 23 ++- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/drivers/block/drbd/drbd_nl.c b/drivers/block/drbd/drbd_nl.c index 5e4adff..4703f1a 1

[PATCH 37/38] drbd: avoid potential deadlock during handshake

2015-11-25 Thread Philipp Reisner
ome standard activity log transactions. Using lc_try_lock_for_transaction() instead of lc_try_lock() does not care about pending activity log references, avoiding the potential deadlock. Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_actlog.c | 19 +++--

[PATCH 07/38] drbd: Fix locking across all resources

2015-11-25 Thread Philipp Reisner
prevent changes of that resource. (Previously, a read lock on the global state lock was needed as well.) Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_int.h| 18 ++--- drivers/block/drbd/drbd_main.c | 24 +++- drivers/block/drbd

[PATCH 16/38] drbd: add comment why we want to first call local-io-error, then send state

2015-11-25 Thread Philipp Reisner
crash", without bumping the data generation UUIDs on the peer in between, it makes it easier to deal with. If you intend to return from the local-io-error handler, then better return as quickly as possible to avoid triggering other timeouts. Signed-off-by: Philipp Reisner Signed-off-by: Lars

[PATCH 13/38] drbd: drop remnants of connector -- we don't use it anymore in drbd 8.4

2015-11-25 Thread Philipp Reisner
From: Lars Ellenberg Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- include/linux/drbd.h | 1 - 1 file changed, 1 deletion(-) diff --git a/include/linux/drbd.h b/include/linux/drbd.h index 2c44d7e..392fc0e 100644 --- a/include/linux/drbd.h +++ b/include/linux/drbd.h

[PATCH 24/38] drbd: debugfs: expose ed_data_gen_id

2015-11-25 Thread Philipp Reisner
From: Lars Ellenberg The effective data generation ID may be interesting for debugging purposes of scenarios involving diskless states. Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_debugfs.c | 10 ++ drivers/block/drbd/drbd_int.h | 1

[PATCH 22/38] drbd: Create a dedicated workqueue for sending acks on the control connection

2015-11-25 Thread Philipp Reisner
. One exception in that is sending back ping_acks. These stay in the ack-receiver thread. Otherwise the logic becomes too complicated for no added value. Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_int.h | 27 ++--- drivers/block/drbd/drbd_main.c

[PATCH 03/38] drbd: De-inline drbd_should_do_remote() and drbd_should_send_out_of_sync()

2015-11-25 Thread Philipp Reisner
From: Andreas Gruenbacher There is no need to have these two as inline functions. In addition, drbd_should_send_out_of_sync() is only used in a single place, anyway. Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_req.c | 18

[PATCH 14/38] drbd: drbdsetup detach of an unresponsive local disk should not block IO "forever"

2015-11-25 Thread Philipp Reisner
ble to continue IO to and from a healthy peer. Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_nl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/block/drbd/drbd_nl.c b/drivers/block/drbd/drbd_nl.c index af78f09..331b378 10

[PATCH 31/38] lru_cache: Converted lc_seq_printf_status to return void

2015-11-25 Thread Philipp Reisner
From: Roland Kammerer Fix the semantic of lc_seq_printf. Currently, it always returns 0 and the return value is unused, therefore, convert the return type to void. Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- include/linux/lru_cache.h | 2 +- lib/lru_cache.c | 4

[PATCH 28/38] drbd: fix spurious alert level printk

2015-11-25 Thread Philipp Reisner
e the range estimate returned by drbd_md_last_sector() was still wrong. Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_main.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c index 3a9

[PATCH 23/38] drbd: prevent NULL pointer deref when resuming diskless primary

2015-11-25 Thread Philipp Reisner
et without first being demoted (deconfigured). Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_nl.c | 25 - 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/drivers/block/drbd/drbd_nl.c b/drivers/block/drbd/drbd_nl.c index

[PATCH 05/38] drbd: Move enum write_ordering_e to drbd.h

2015-11-25 Thread Philipp Reisner
From: Andreas Gruenbacher Also change the enum values to all-capital letters. Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_int.h | 6 -- drivers/block/drbd/drbd_main.c | 2 +- drivers/block/drbd/drbd_nl.c | 4 ++-- drivers

[PATCH 38/38] drbd: fix error path during resize

2015-11-25 Thread Philipp Reisner
ta related offsets/sizes, and on error restore them all. Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_nl.c | 68 +--- 1 file changed, 38 insertions(+), 30 deletions(-) diff --git a/drivers/block/drbd/drbd_nl.c

[PATCH 7/7] drbd: Remove an useless copy of kernel_setsockopt()

2014-11-10 Thread Philipp Reisner
Old backward-compat cruft Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_int.h | 29 - 1 file changed, 4 insertions(+), 25 deletions(-) diff --git a/drivers/block/drbd/drbd_int.h b/drivers/block/drbd/drbd_int.h index

[PATCH 1/7] drbd: Minor cleanups

2014-11-10 Thread Philipp Reisner
From: Andreas Gruenbacher . Update comments . drbd_set_{in,out_of}_sync(): Remove unused parameters . Move common code into adm_del_resource() . Redefine ERR_MINOR_EXISTS -> ERR_MINOR_OR_VOLUME_EXISTS Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/d

[PATCH 3/7] drbd: fix race between role change and handshake

2014-11-10 Thread Philipp Reisner
In order to avoid deadlocks give up the state_mutex while waiting for the transient state to go away. Conflicts: drbd/drbd_state.c drbd/drbd_state.h drbd/drbd_wrappers.h Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_nl

[PATCH 2/7] drbd: Only use drbd_msg_put_info() in drbd_nl.c

2014-11-10 Thread Philipp Reisner
From: Andreas Gruenbacher Avoid generic netlink calls in other parts of the code base. Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_int.h | 1 - drivers/block/drbd/drbd_main.c | 17 +++-- drivers/block/drbd/drbd_nl.c | 2 +- 3

[PATCH 0/7] DRBD updates for the 3.19 merge window

2014-11-10 Thread Philipp Reisner
(marked for stable) Thanks! Andreas Gruenbacher (2): drbd: Minor cleanups drbd: Only use drbd_msg_put_info() in drbd_nl.c Lars Ellenberg (2): drbd: fix resync throttling initialization drbd: merge_bvec_fn: properly remap bvm->bi_bdev Philipp Reisner (3): drbd: fix race between r

[PATCH 5/7] drbd: merge_bvec_fn: properly remap bvm->bi_bdev

2014-11-10 Thread Philipp Reisner
From: Lars Ellenberg This was not noticed for many years. Affects operation if md raid is used a backing device for DRBD. CC: sta...@kernel.org # v3.2+ Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_req.c | 1 + 1 file changed, 1 insertion(+) diff

[PATCH 4/7] drbd: fix resync throttling initialization

2014-11-10 Thread Philipp Reisner
end event counters, and drops the rs_last_events == 0 from the throttle condition. Reported-by: Mikhail Sugakov Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_receiver.c | 2 +- drivers/block/drbd/drbd_state.c| 1 - drivers/block/drbd/drbd_worker.c

[PATCH 6/7] drbd: Fix state change in case of connection timeout

2014-11-10 Thread Philipp Reisner
ollow up failures. E.g. "BUG: scheduling while atomic" CC: sta...@kernel.org # v3.17 Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_req.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/block/drbd/drbd_req.c b/

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

2016-04-25 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 01/30] drbd: bitmap bulk IO: do not always suspend IO

2016-04-25 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 20/30] drbd: discard_zeroes_if_aligned allows "thin" resync for discard_zeroes_data=0

2016-04-25 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 06/30] drbd: Create the protocol feature THIN_RESYNC

2016-04-25 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 18/30] drbd: if there is no good data accessible, writes should be IO errors

2016-04-25 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 14/30] drbd: allow larger max_discard_sectors

2016-04-25 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 25/30] drbd: bump current uuid when resuming IO with diskless peer

2016-04-25 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 16/30] drbd: introduce unfence-peer handler

2016-04-25 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 09/30] drbd: fix for truncated minor number in callback command line

2016-04-25 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 07/30] drbd: adjust assert in w_bitmap_io to account for BM_LOCKED_CHANGE_ALLOWED

2016-04-25 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 3cecc4f..3127bba 100644 --- a

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

2016-04-25 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 03/30] drbd: Kill code duplication

2016-04-25 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 1fd1dcc..bb71e73 100644 --- a/drivers/block

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

2016-04-25 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 12/30] drbd: possibly disable discard support, if backend has discard_zeroes_data=0

2016-04-25 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 19/30] drbd: only restart frozen disk io when D_UP_TO_DATE

2016-04-25 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 10/30] drbd: allow parallel flushes for multi-volume resources

2016-04-25 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 05/30] drbd: Introduce new disk config option rs-discard-granularity

2016-04-25 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 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

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

2016-04-25 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 13/30] drbd: zero-out partial unaligned discards on local backend

2016-04-25 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 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 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 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

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, > >

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: [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 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

[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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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

<    1   2   3   4   5   >