[PATCH 5/9] drbd: Get rid of the __no_warn and __cond_lock macros

2014-09-11 Thread Philipp Reisner
From: Andreas Gruenbacher These macros can easily be replaced with its definition. Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_int.h| 11 ++- drivers/block/drbd/drbd_worker.c | 9 ++--- 2 files changed, 12 insertions(+), 8

[PATCH 1/9] drbd: Use better variable names

2014-09-11 Thread Philipp Reisner
From: Andreas Gruenbacher Rename local variable 'ds' to 'disk_state' or 'data_size'. 'dgs' to 'digest_size' Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_int.h | 6 ++--- drivers/block/drbd/drb

[GIT pull] DRBD code reorganization

2014-02-17 Thread Philipp Reisner
worker thread, process drbd_work instead of drbd_device_work items drbd: Get rid of first_peer_device() in handle_write_conflicts() drbd: Remove unused parameter of wire_flags_to_bio() drbd: Use the right peer device drbd: Add drbd_thread->resource and make drbd_thread->connection optional

[PATCH 07/20] drbd: Limit the time we are waiting for the first packet on an accepted socket

2014-07-01 Thread Philipp Reisner
mentioned patch we had no timeout at all. Now use 4 times the ping-timeout. Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_receiver.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/drivers/block/drbd/drbd_receiver.c b/drivers/

[PATCH 05/20] drbd: don't implicitly resize Diskless node beyond end of device

2014-07-01 Thread Philipp Reisner
d-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_receiver.c | 19 --- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/drivers/block/drbd/drbd_receiver.c b/drivers/block/drbd/drbd_receiver.c index 2fcc3af..5626c5b 100644 --- a/dr

[PATCH 01/20] drbd: drop wrong debugging aid

2014-07-01 Thread Philipp Reisner
-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_proc.c | 17 - 1 file changed, 17 deletions(-) diff --git a/drivers/block/drbd/drbd_proc.c b/drivers/block/drbd/drbd_proc.c index f11e573..46bb8dd 100644 --- a/drivers/block/drbd/drbd_proc.c +++ b/drivers/bl

[PATCH 18/20] drbd: drop drbd_md_flush

2014-07-01 Thread Philipp Reisner
From: Lars Ellenberg The only user of drbd_md_flush was bm_rw(), and it is always followed by either a drbd_md_sync(), or an al_write_transaction(), which, if so configured, both end up submiting a FLUSH|FUA request anyways. Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg

[PATCH 02/20] drbd: silence -Wmissing-prototypes warnings

2014-07-01 Thread Philipp Reisner
From: Lars Ellenberg Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_main.c | 2 +- drivers/block/drbd/drbd_nl.c | 2 +- drivers/block/drbd/drbd_receiver.c | 3 +-- drivers/block/drbd/drbd_req.h | 1 + drivers/block/drbd/drbd_state.c

[PATCH 17/20] drbd: add drbd_queue_work_if_unqueued helper

2014-07-01 Thread Philipp Reisner
work structs, we must avoid to re-add until it really was removed. Move that list_empty check inside the spin_lock(&q->q_lock) within the helper function, and change to list_empty_careful(). This may have been the reason for a list_add corruption inside drbd_queue_work(). Signed-off-

[PATCH 20/20] drbd: also keep track of trim -> zero-out fallback peer_requests

2014-07-01 Thread Philipp Reisner
From: Lars Ellenberg To be able to find and present such zero-out fallback peer_requests in debugfs, we add those to "active_ee", once that list drained. Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_receiver.c | 5 + 1 file

[PATCH 19/20] drbd: consistently use list_add_tail for peer_request tracking

2014-07-01 Thread Philipp Reisner
From: Lars Ellenberg Keep the epoch entry lists (active_ee, read_ee, sync_ee, ...) consistently "oldest first". That way finding the oldest not yet successfully processed request is simply list_first_entry_or_null. Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --

[PATCH 16/20] drbd: drbd_rs_number_requests: fix unit mismatch in comparison

2014-07-01 Thread Philipp Reisner
ght 512 Byte sectors, and this extra throttle triggered much earlier than intended. Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_worker.c | 13 + 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/drivers/block/drbd/drbd_worker.c

[PATCH 13/20] drbd: improve resync request throttling due to sendbuf size

2014-07-01 Thread Philipp Reisner
From: Lars Ellenberg If we throttle resync because the socket sendbuffer is filling up, tell TCP about it, so it may expand the sendbuffer for us. Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_worker.c | 23 ++- 1 file changed

[PATCH 15/20] drbd: cosmetic: change all printk(level, ...) to pr_(...)

2014-07-01 Thread Philipp Reisner
From: Lars Ellenberg Cosmetic change only. Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_bitmap.c | 9 - drivers/block/drbd/drbd_int.h| 4 +--- drivers/block/drbd/drbd_main.c | 28 +--- drivers/block/drbd

[PATCH 09/20] drbd: application writes may set-in-sync in protocol != C

2014-07-01 Thread Philipp Reisner
From: Lars Ellenberg If "dirty" blocks are written to during resync, that brings them in-sync. By explicitly requesting write-acks during resync even in protocol != C, we now can actually respect this. Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/

[PATCH 10/20] drbd: short-circuit in maybe_pull_ahead

2014-07-01 Thread Philipp Reisner
From: Lars Ellenberg If we already "pulled ahead", we can short-circuit, and avoid logging the same messages over and over again. Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_req.c | 3 +++ 1 file changed, 3 insertions(+) diff --git

[PATCH 00/20] RFC DRBD fixes

2014-07-01 Thread Philipp Reisner
(x, NULL) in drbd/drbd_state.c Philipp Reisner (2): drbd: Limit the time we are waiting for the first packet on an accepted socket drbd: New net configuration option socket-check-timeout drivers/block/drbd/drbd_bitmap.c | 13 ++-- drivers/block/drbd/drbd_int.h

[PATCH 11/20] drivers/block: Use RCU_INIT_POINTER(x, NULL) in drbd/drbd_state.c

2014-07-01 Thread Philipp Reisner
From: Monam Agarwal This patch replaces rcu_assign_pointer(x, NULL) with RCU_INIT_POINTER(x, NULL) The rcu_assign_pointer() ensures that the initialization of a structure is carried out before storing a pointer to that structure. And in the case of the NULL pointer, there is no structure to init

[PATCH 06/20] drbd: implement csums-after-crash-only

2014-07-01 Thread Philipp Reisner
le to configure checksum based resync, but only actually use it for the first resync after primary crash. Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_int.h | 2 ++ drivers/block/drbd/drbd_receiver.c | 2 ++ drivers/block/drbd/drbd_

[PATCH 08/20] drbd: New net configuration option socket-check-timeout

2014-07-01 Thread Philipp Reisner
same data center such a long wait time may hinder DRBD's connect process. In such setups socket-check-timeout should be set to at least to the round trip time between DRBD and DRBD-proxy. I.e. in most cases to 1. Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block

[PATCH 03/20] drbd: Remove unnecessary/unused code

2014-07-01 Thread Philipp Reisner
ll activity log just because we had been Primary before the reboot. Once we have that implemented, we may re-introduce the reboot notifier. Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_int.h | 1 - drivers/block/drbd/drbd_main.c | 18 --

[PATCH 04/20] drbd: fix bogus resync stats in /proc/drbd

2014-07-01 Thread Philipp Reisner
the total number of blocks within this resync has just been reset to 0 when accessing it. This now produces bogus numbers in the resync speed estimates. Fix by accessing all relevant data only once, and fixing it up if "still to go" happens to be more than "total". Signed-off

[PATCH 14/20] drbd: clear CRASHED_PRIMARY only after successful resync

2014-07-01 Thread Philipp Reisner
From: Lars Ellenberg If we lost a disk during the first resync after primary crash, we could have prematurely cleared the CRASHED_PRIMARY flag. Testing on C_CONNECTED is not what we meant there, but testing for both peers to become D_UP_TO_DATE. Signed-off-by: Philipp Reisner Signed-off-by

[PATCH 12/20] block: Convert last uses of __FUNCTION__ to __func__

2014-07-01 Thread Philipp Reisner
From: Joe Perches Just about all of these have been converted to __func__, so convert the last uses. Signed-off-by: Joe Perches Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_int.h | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/block/drbd/drbd_i

Re: [Drbd-dev] [PATCH 15/20] drbd: cosmetic: change all printk(level, ...) to pr_(...)

2014-07-02 Thread Philipp Reisner
Am Dienstag, 1. Juli 2014, 09:30:37 schrieb Joe Perches: > On Tue, 2014-07-01 at 18:16 +0200, Philipp Reisner wrote: > > From: Lars Ellenberg > > > > Cosmetic change only. > > [] > > > diff --git a/drivers/block/drbd/drbd_bitmap.c > > b/drivers/bloc

[PATCH 01/23] drbd: poison free'd device, resource and connection structs

2014-07-03 Thread Philipp Reisner
From: Lars Ellenberg Now that we have additional asynchronous kref_get/kref_put via debugfs, make sure we catch access after free. Poison struct drbd_device, drbd_connection and drbd_resource before kfree() with 0xfd, 0xfc, and 0xf2, respectively. Signed-off-by: Philipp Reisner Signed-off-by

[PATCH 12/23] drbd: debugfs: add in_flight_summary data

2014-07-03 Thread Philipp Reisner
waiting for activity log transaction * waiting for local disk * waiting to be sent * waiting for peer acknowledgement ("receive ack", "write ack") * waiting for peer epoch acknowledgement ("barrier ack") Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellen

[PATCH 14/23] drbd: debugfs: Add in_flight_summary

2014-07-03 Thread Philipp Reisner
fer stats along with the timing details of requests, peer requests, and meta data IO. * pending bitmap IO timing details to in_flight_summary. Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_debugfs.c | 231 -

[PATCH 16/23] drbd: debugfs: add per volume oldest_requests

2014-07-03 Thread Philipp Reisner
From: Lars Ellenberg Show oldest requests * pending master bio completion and, * if different, local disk bio completion. Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_debugfs.c | 153 -- lib/lru_cache.c

[PATCH 17/23] drbd: debugfs: add version tag to debugfs files

2014-07-03 Thread Philipp Reisner
From: Lars Ellenberg Make the first line of debugfs files a version number, starting now with "v: 0". If we change content of presentation, we will bump that. Monitoring or diagnostic scritps that may parse these files can then easily know when they need to be reviewed. Signed-off-b

[PATCH 18/23] drbd: debugfs: add per connection oldest requests

2014-07-03 Thread Philipp Reisner
/oldest_requests Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_debugfs.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/drivers/block/drbd/drbd_debugfs.c b/drivers/block/drbd/drbd_debugfs.c index a4d0666..db70d6c 100644 --- a/drivers/block

[PATCH 20/23] drbd: resync should only lock out specific ranges

2014-07-03 Thread Philipp Reisner
is when we cannot start requests to "cold" extents because all currently "hot" extents are actually used. Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_actlog.c | 15 - drivers/block/drbd/drbd_req.c| 136 ++

[PATCH 15/23] drbd: debugfs: add callback_history

2014-07-03 Thread Philipp Reisner
From: Lars Ellenberg Add a per-connection worker thread callback_history with timing details, call site and callback function. Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_debugfs.c | 78 ++ drivers/block/drbd

[PATCH 19/23] drbd: debugfs: add per device data_gen_id

2014-07-03 Thread Philipp Reisner
From: Lars Ellenberg The data generation identifiers used to be exposed via sysfs at /sys/block/drbdX/drbd/meta_data/data_gen_id (out-of-tree), for advanced policy scripting. Bring that information over to debugfs. Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers

[PATCH 21/23] drbd: drop spurious parameters from _drbd_md_sync_page_io

2014-07-03 Thread Philipp Reisner
From: Lars Ellenberg size is always 4096, page is always device->md_io.page. Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_actlog.c | 12 +--- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/block/drbd/drbd_actlog.

[PATCH 23/23] drbd: silence underflow warning in read_in_block()

2014-07-03 Thread Philipp Reisner
From: Dan Carpenter My static checker warns that "data_size" could be negative and underflow the limit check. The code looks suspicious but I don't know if it is a real bug. Signed-off-by: Dan Carpenter Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- dri

[PATCH 13/23] drbd: debugfs: deal with destructor racing with open of debugfs file

2014-07-03 Thread Philipp Reisner
, we check for existence of a parent directory, "stale-ness" of "this" dentry, and serialize kref_get_unless_zero() on the outermost object relevant for this file with d_delete() on this dentry (using the parent's i_mutex). Signed-off-by: Philipp Reisner Signed-off-by: Lar

[PATCH 11/23] drbd: debugfs: add basic hierarchy

2014-07-03 Thread Philipp Reisner
ill populate this hierarchy with files containing statistics, diagnostic information and some attribute data. Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/drbd/Makefile | 1 + drivers/block/drbd/drbd_debugfs.c | 191 ++ driv

[PATCH 22/23] drbd: implicitly truncate cpu-mask

2014-07-03 Thread Philipp Reisner
From: Lars Ellenberg Don't error out with misleading "out of memory" if the cpu-mask has more bits set than there are CPUs. Just truncate to nr_cpu_ids implicitly. Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_main.c | 14 +++

[PATCH 05/23] drbd: add lists to find oldest pending requests

2014-07-03 Thread Philipp Reisner
From: Lars Ellenberg Adding requests to per-device fifo lists as soon as possible after allocating them leaves a simple list_first_entry_or_null() to find the oldest request, regardless what it is still waiting for. Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers

[PATCH 07/23] drbd: improve throttling decisions of background resynchronisation

2014-07-03 Thread Philipp Reisner
ue to such voluntary throttling. Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_actlog.c | 29 ++--- drivers/block/drbd/drbd_int.h | 4 +++- drivers/block/drbd/drbd_main.c | 1 + drivers/block/drbd/drbd_proc.c |

[PATCH 06/23] drbd: add caching oldest request pointers for replication stages

2014-07-03 Thread Philipp Reisner
ed (req_ack_pending) and the oldest "still waiting for something from the peer" (req_not_net_done), doing short list walks on the transfer log to find the next pending one whenever such a request makes progress. Now we have a fast way to look up the oldest requests, don't do a transfer l

[PATCH 08/23] drbd: track timing details of peer_requests

2014-07-03 Thread Philipp Reisner
able to present the peer_request state accurately in debugfs, and what it is waiting for. Consistently mark/unmark peer requests with EE_CALL_AL_COMPLETE_IO. Set it only *after* calling drbd_al_begin_io(), clear it as soon as we call drbd_al_complete_io(). Signed-off-by: Philipp Reisner Signed-off

[PATCH 00/23] RFC DRBD fixes

2014-07-03 Thread Philipp Reisner
Hi, this series adds a debugfs hierarchy to DRBD. It unveils a lot of information about timing of states/stages of IO requests. This information helps a lot while optimizing DRBD for SSD based IO stacks. Dan Carpenter (1): drbd: silence underflow warning in read_in_block() Lars Ellenberg (22)

[PATCH 02/23] drbd: fix drbd_destroy_device reference count updates

2014-07-03 Thread Philipp Reisner
#x27;d leak connection refs. Instead, iterate via device->peer_devices->connection. Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_main.c | 14 +- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/drivers/block/drbd/drbd

[PATCH 09/23] drbd: register peer requests on read_ee early

2014-07-03 Thread Philipp Reisner
From: Lars Ellenberg Initialize peer_request with timestamp and proper empty list head. Add peer_request to list early, so debugfs can find this request and report it as "preparing", even if we sleep before we actually submit it. Signed-off-by: Philipp Reisner Signed-off-by: Lars

[PATCH 10/23] drbd: track details of bitmap IO

2014-07-03 Thread Philipp Reisner
From: Lars Ellenberg Track start and submit time of bitmap operations, and add pending bitmap IO contexts to a new pending_bitmap_io list. Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_bitmap.c | 70 +++- drivers

[PATCH 04/23] drbd: gather detailed timing statistics for drbd_requests

2014-07-03 Thread Philipp Reisner
-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_int.h| 54 ++- drivers/block/drbd/drbd_main.c | 7 +-- drivers/block/drbd/drbd_req.c| 93 +--- drivers/block/drbd/drbd_worker.c | 3 ++ 4 files

[PATCH 03/23] drbd: track meta data IO intent, start and submit time

2014-07-03 Thread Philipp Reisner
From: Lars Ellenberg For diagnostic purposes, track intent, start time and latest submit time of meta data IO. Move separate members from struct drbd_device into the embeded struct drbd_md_io. s/md_io_(page|in_use)/md_io.\1/ Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg

[PATCH 00/18] RFC DRBD fixes

2014-06-30 Thread Philipp Reisner
ter we persisted the new role drbd: explicitly submit meta data requests with REQ_NOIDLE drbd: close race when detaching from disk drbd: make sure disk cleanup happens in worker context drbd: use drbd_device_post_work() in more places drbd: get rid of drbd_queue_work_front Philipp Reisn

[PATCH 03/18] drbd: rename drbd_free_bc() to drbd_free_ldev()

2014-06-30 Thread Philipp Reisner
Since the member of drbd_device is called ldev Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_int.h | 2 +- drivers/block/drbd/drbd_main.c | 8 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/block/drbd/drbd_int.h b

[PATCH 17/18] drbd: use drbd_device_post_work() in more places

2014-06-30 Thread Philipp Reisner
From: Lars Ellenberg This replaces the md_sync_work member of struct drbd_device by a new MD_SYNC "work bit" in device->flags. This replaces the resync_start_work member of struct drbd_device by a new RS_START "work bit" in device->flags. Signed-off-by: Philipp Re

[PATCH 15/18] drbd: close race when detaching from disk

2014-06-30 Thread Philipp Reisner
ldev_destroy() drbd_ldev_destroy(); Trying to fix this by checking the disk state *before* the atomic_dec_return(), which implies memory barriers, and by inserting extra memory barriers around the state assignment in __drbd_set_state(). Signed-off-by: Philipp Reisner Signed-off-by: La

[PATCH 16/18] drbd: make sure disk cleanup happens in worker context

2014-06-30 Thread Philipp Reisner
new work bits. Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_actlog.c | 9 +--- drivers/block/drbd/drbd_int.h| 40 +++- drivers/block/drbd/drbd_main.c | 59 --- drivers/block/drbd/drbd_nl.c | 2 +- drive

[PATCH 14/18] drbd: explicitly submit meta data requests with REQ_NOIDLE

2014-06-30 Thread Philipp Reisner
From: Lars Ellenberg For some reason we have assumed NOIDLE was implied by one of the other flags we set. It is not (anymore?). Explicitly set REQ_NOIDLE for synchronous meta data updates, or we can seriously starve random writes when using CFQ. Signed-off-by: Philipp Reisner Signed-off-by

[PATCH 04/18] drbd: reduce number of spinlock drop/re-aquire cycles

2014-06-30 Thread Philipp Reisner
From: Lars Ellenberg Instead of dropping and re-aquiring the spinlock around the submit, just remember that we want to submit, and do that only once we have dropped the spinlock for good. Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_req.c | 20

[PATCH 13/18] drbd: move set_disk_ro() to after we persisted the new role

2014-06-30 Thread Philipp Reisner
From: Lars Ellenberg This probably does not have any real life impact, but we should first persist any potentially new UUID and other meta data flags, as well as our new role, before we allow/disallow write access. Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers

[PATCH 09/18] drbd: fix resync finished detection

2014-06-30 Thread Philipp Reisner
-finished condition needs to be tested before the schedule() in wait_for_work, or it is likely to be missed. Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_actlog.c | 315 ++- drivers/block/drbd/drbd_int.h| 42 -

[PATCH 12/18] drbd: trigger tcp_push_pending_frames() for PING and PING_ACK

2014-06-30 Thread Philipp Reisner
From: Lars Ellenberg This should reduce latency for such in-DRBD-protocol "pings", and may help reduce spurious disconnect/reconnect cycles due to "PingAck did not arrive in time." Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd

[PATCH 06/18] drbd: allow write-ordering policy to be bumped up again

2014-06-30 Thread Philipp Reisner
CU in drbd_bump_write_ordering() max_allowed_wo() uses rcu_dereference, therefore it must be called within rcu_read_lock()/rcu_read_unlock() Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_nl.c | 10 +- drivers/block/drbd/drbd_receiver.c | 6 -- 2

[PATCH 08/18] drbd: fix a race stopping the worker thread

2014-06-30 Thread Philipp Reisner
== RUNNING before we schedule() Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_worker.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/block/drbd/drbd_worker.c b/drivers/block/drbd/drbd_worker.c index 5915885..47bc840 100644 --- a/drivers/

[PATCH 07/18] drbd: get rid of atomic update on disk bitmap works

2014-06-30 Thread Philipp Reisner
). Now we trigger "merge friendly" bulk write out of all cleared pages every two seconds during resync, and once the resync is finished. Most pages will be written out only once. Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_act

[PATCH 11/18] drbd: re-add lost conf_mutex protection in drbd_set_role

2014-06-30 Thread Philipp Reisner
ith drbd: Fix a potential deadlock in drbdsetup, introduce resource->adm_mutex And I simply forgot to put it back in at the original location. Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_nl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 del

[PATCH 10/18] drbd: stop the meta data sync timer before open coded meta data sync

2014-06-30 Thread Philipp Reisner
From: Lars Ellenberg If we re-write all meta data due to resize, we have open-coded write-out of our meta data super block. Stop the md_sync_timer, it would just trigger scary but in this case spurious "timer expired" messages. Signed-off-by: Philipp Reisner Signed-off-by: Lars

[PATCH 05/18] drbd: refactor use of first_peer_device()

2014-06-30 Thread Philipp Reisner
From: Lars Ellenberg Reduce the number of calls to first_peer_device(). Instead, call first_peer_device() just once to assign a local variable peer_device. Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_nl.c | 30 +++--- drivers

[PATCH 18/18] drbd: get rid of drbd_queue_work_front

2014-06-30 Thread Philipp Reisner
al_write_transaction callback, and drop drbd_queue_work_front. Do not (yet) change dequeue_work_item to dequeue_work_batch, though. Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_actlog.c | 69 -- drivers/b

[PATCH 02/18] drbd: device->ldev is not guaranteed on an D_ATTACHING disk

2014-06-30 Thread Philipp Reisner
(device, D_ATTACHING) with the wrong assumption. Remove it, and allow the caller to pass in a struct drbd_backing_dev* when the caller knows that accessing this bdev is safe. Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_bitmap.c | 4 +++- drivers

[PATCH 01/18] drbd: Move write_ordering from connection to resource

2014-06-30 Thread Philipp Reisner
Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_int.h | 5 +++-- drivers/block/drbd/drbd_main.c | 2 +- drivers/block/drbd/drbd_nl.c | 4 ++-- drivers/block/drbd/drbd_proc.c | 2 +- drivers/block/drbd/drbd_receiver.c | 25

[PATCH] Fix DRBD regression

2014-07-09 Thread Philipp Reisner
Hi Jens, In 3.13 the commit 786235eeb 'kthread: make kthread_create() killable' broke DRBD's fence peer mechanism in a subtle way. Since only a part of our user base has fencing properly configured this regression was unnoticed until now. Please consider to submit this for 3.16-rc5. Thanks, Phil

[PATCH] drbd: fix regression 'out of mem, failed to invoke fence-peer helper'

2014-07-09 Thread Philipp Reisner
that as a new fatal signal and fail. Fix: flush_signals() before kthread_run(). Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_nl.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/block/drbd/drbd_nl.c b/drivers/block/drbd/drbd_nl.c

Re: [PATCH] drbd: fix regression 'out of mem, failed to invoke fence-peer helper'

2014-07-10 Thread Philipp Reisner
Am Donnerstag, 10. Juli 2014, 11:07:22 schrieb Jens Axboe: > On 2014-07-09 21:18, Philipp Reisner wrote: > > From: Lars Ellenberg > > > > Since linux kernel 3.13, kthread_run() internally uses > > wait_for_completion_killable(). We sometimes may use kthread_run(

[GIT PULL] DRBD updates for your for-3.17/drivers branch

2014-07-10 Thread Philipp Reisner
NULL) in drbd/drbd_state.c Philipp Reisner (5): drbd: Move write_ordering from connection to resource drbd: device->ldev is not guaranteed on an D_ATTACHING disk drbd: rename drbd_free_bc() to drbd_free_ldev() drbd: Limit the time we are waiting for the first packet on an

Re: [GIT PULL] DRBD updates for your for-3.17/drivers branch

2014-07-10 Thread Philipp Reisner
ock out specific ranges drbd: drop spurious parameters from _drbd_md_sync_page_io drbd: implicitly truncate cpu-mask Monam Agarwal (1): drivers/block: Use RCU_INIT_POINTER(x, NULL) in drbd/drbd_state.c Philipp Reisner (5): drbd: Move write_ordering from connection to resource

[PATCH] Fix DRBD regression

2014-06-25 Thread Philipp Reisner
Hi Jens, this patch is intended for 3.16-rc3 (or -rc4). The issue was introduced with the 3.16 merge window, while adding support for REQ_DISCARD to DRBD. Please see the commit message for more details. best regards, Phil Lars Ellenberg (1): drbd: fix NULL pointer deref in blk_add_request_pay

[PATCH] drbd: fix NULL pointer deref in blk_add_request_payload

2014-06-25 Thread Philipp Reisner
From: Lars Ellenberg Discards don't have any payload. But the scsi layer still expects a bio_vec it can use internally, see sd_setup_discard_cmnd() and blk_add_request_payload(). Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_receiver.c | 5 +++

[PATCH 5/5] drbd: avoid to shrink max_bio_size due to peer re-configuration

2013-10-23 Thread Philipp Reisner
o allow it a bit earlier during the handshake. Also consider max_hw_sectors in our merge bvec function, just in case. Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_nl.c |4 ++-- drivers/block/drbd/drbd_req.c |3 +++ 2 files changed, 5 insertio

[PATCH 0/5] Some DRBD fixes for the 3.13 merge window

2013-10-23 Thread Philipp Reisner
oid to shrink max_bio_size due to peer re-configuration Philipp Reisner (2): drbd: Fix an connection drop issue after enabling allow-two-primaries drbd: Fix adding of new minors with freshly created meta data drivers/block/drbd/drbd_int.h |3 ++- drivers/block/drbd/drbd_main.c |

[PATCH 1/5] drbd: fix NULL pointer deref in module init error path

2013-10-23 Thread Philipp Reisner
From: Lars Ellenberg If we want to iterate over the (as of yet still empty) list in the cleanup path, we need to initialize the list before the first goto fail. Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_main.c | 19 +-- 1 file

[PATCH 2/5] drbd: Fix an connection drop issue after enabling allow-two-primaries

2013-10-23 Thread Philipp Reisner
always tracking the sequence number, but only waiting for it if allow-two-primaries is set. Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_receiver.c | 39 +++- 1 file changed, 16 insertions(+), 23 deletions(-) diff

[PATCH 3/5] drbd: Fix adding of new minors with freshly created meta data

2013-10-23 Thread Philipp Reisner
wrongly got into the code path for resyncing new storage that was added while the disk was detached. Fixed that by making the GREW from ZERO a special case. Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_int.h |3 ++- drivers/block/drbd/drbd_nl.c |2

[PATCH 4/5] drbd: fix decoding of bitmap vli rle for device sizes > 64 TB

2013-10-23 Thread Philipp Reisner
ult of which is "undefined" :( (only "sometimes" the result is the desired 0) Fix: don't do any bit shift magic for shift == 64, just assign. Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_receiver.c |6 +- 1 file chang

[PATCH 00/26] DRBD code reorganization

2013-12-20 Thread Philipp Reisner
s any connections drbd: drbd_create_device(): Take a resource instead of a connection argument Philipp Reisner (1): drbd: Add missing error goto Documentation/blockdev/drbd/data-structure-v9.txt | 38 + drivers/block/drbd/drbd_actlog.c | 624 +++--- driv

[PATCH 26/26] drbd: drbd_create_device(): Take a resource instead of a connection argument

2013-12-20 Thread Philipp Reisner
From: Andreas Gruenbacher Signed-off-by: Andreas Gruenbacher Signed-off-by: Philipp Reisner --- drivers/block/drbd/drbd_int.h |2 +- drivers/block/drbd/drbd_main.c |4 ++-- drivers/block/drbd/drbd_nl.c |2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a

[PATCH 12/26] drbd: Add struct drbd_device->resource

2013-12-20 Thread Philipp Reisner
From: Andreas Gruenbacher Signed-off-by: Andreas Gruenbacher Signed-off-by: Philipp Reisner --- drivers/block/drbd/drbd_int.h |1 + drivers/block/drbd/drbd_main.c |1 + drivers/block/drbd/drbd_nl.c |4 ++-- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers

[PATCH 13/26] drbd: Minor cleanup in conn_new_minor()

2013-12-20 Thread Philipp Reisner
From: Andreas Gruenbacher Signed-off-by: Andreas Gruenbacher Signed-off-by: Philipp Reisner --- drivers/block/drbd/drbd_main.c | 19 +-- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c index

[PATCH 03/26] drbd: Describe the future high-level structure of DRBD

2013-12-20 Thread Philipp Reisner
From: Andreas Gruenbacher The following commits will successively transform DRBD into the structure described here. Signed-off-by: Andreas Gruenbacher Signed-off-by: Philipp Reisner --- Documentation/blockdev/drbd/data-structure-v9.txt | 38 + 1 file changed, 38

[PATCH 14/26] drbd: Add struct drbd_resource->devices

2013-12-20 Thread Philipp Reisner
From: Andreas Gruenbacher This allows to access the volumes of a resource by number. Signed-off-by: Andreas Gruenbacher Signed-off-by: Philipp Reisner --- drivers/block/drbd/drbd_int.h |2 ++ drivers/block/drbd/drbd_main.c | 62 +++- drivers/block

[PATCH 16/26] drbd: conn_try_disconnect(): Use parameter instead of the global variable

2013-12-20 Thread Philipp Reisner
From: Andreas Gruenbacher Signed-off-by: Andreas Gruenbacher Signed-off-by: Philipp Reisner --- 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 d7c7c24..e804487 100644 --- a

[PATCH 11/26] drbd: drbd_adm_down(): Move valid resource name check to drbd_adm_prepare()

2013-12-20 Thread Philipp Reisner
From: Andreas Gruenbacher Signed-off-by: Andreas Gruenbacher Signed-off-by: Philipp Reisner --- drivers/block/drbd/drbd_nl.c |9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/block/drbd/drbd_nl.c b/drivers/block/drbd/drbd_nl.c index a332399..7e22046

[PATCH 21/26] drbd: Replace and remove the obsolete conn_() macros

2013-12-20 Thread Philipp Reisner
From: Andreas Gruenbacher With the polymorphic drbd_() macros, we no longer need the connection specific variants. Signed-off-by: Andreas Gruenbacher Signed-off-by: Philipp Reisner --- drivers/block/drbd/drbd_int.h | 10 --- drivers/block/drbd/drbd_main.c | 28 drivers

[PATCH 18/26] drbd: Turn connection->volumes into connection->peer_devices

2013-12-20 Thread Philipp Reisner
From: Andreas Gruenbacher Let connection->peer_devices point to peer devices; connection->volumes was pointing to devices. Signed-off-by: Andreas Gruenbacher Signed-off-by: Philipp Reisner --- drivers/block/drbd/drbd_int.h |7 ++- drivers/block/drbd/drbd_main.c

[PATCH 15/26] drbd: Replace conn_get_by_name() with drbd_find_resource()

2013-12-20 Thread Philipp Reisner
From: Andreas Gruenbacher So far, connections and resources always come in pairs, but in the future with multiple connections per resource, the names will stick with the resources. Signed-off-by: Andreas Gruenbacher Signed-off-by: Philipp Reisner --- drivers/block/drbd/drbd_int.h |2

[PATCH 22/26] drbd: Add explicit device parameter to D_ASSERT

2013-12-20 Thread Philipp Reisner
From: Andreas Gruenbacher The implicit dependency on a variable inside the macro is problematic. Signed-off-by: Andreas Gruenbacher Signed-off-by: Philipp Reisner --- drivers/block/drbd/drbd_actlog.c | 38 - drivers/block/drbd/drbd_bitmap.c |2 +- drivers

[PATCH 25/26] drbd: drbd_adm_new_resource(): Check if resource exists, not if it has any connections

2013-12-20 Thread Philipp Reisner
From: Andreas Gruenbacher Signed-off-by: Andreas Gruenbacher Signed-off-by: Philipp Reisner --- 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 f999e7c..bc56fb0 100644 --- a

[PATCH 20/26] drbd: Turn drbd_printk() into a polymorphic macro

2013-12-20 Thread Philipp Reisner
o one place in the code. Using drbd_printk() on an object type which it doesn't understand results in an undefined drbd_printk_with_wrong_object_type symbol. Signed-off-by: Andreas Gruenbacher Signed-off-by: Philipp Reisner --- drivers/block/drbd/drbd_in

[PATCH 01/26] drbd: Add missing error goto

2013-12-20 Thread Philipp Reisner
Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_nl.c |1 + 1 file changed, 1 insertion(+) diff --git a/drivers/block/drbd/drbd_nl.c b/drivers/block/drbd/drbd_nl.c index c706d50..e75c6db 100644 --- a/drivers/block/drbd/drbd_nl.c +++ b/drivers/block

[PATCH 02/26] idr: Add new function idr_is_empty()

2013-12-20 Thread Philipp Reisner
From: Andreas Gruenbacher Signed-off-by: Andreas Gruenbacher Signed-off-by: Philipp Reisner --- include/linux/idr.h |1 + lib/idr.c | 10 ++ 2 files changed, 11 insertions(+) diff --git a/include/linux/idr.h b/include/linux/idr.h index 871a213..9c95d21 100644 --- a

[PATCH 23/26] drbd: Rename drbd_{create,delete}_minor -> drbd_{create,delete}_device

2013-12-20 Thread Philipp Reisner
From: Andreas Gruenbacher Signed-off-by: Andreas Gruenbacher Signed-off-by: Philipp Reisner --- drivers/block/drbd/drbd_int.h |4 ++-- drivers/block/drbd/drbd_main.c |6 +++--- drivers/block/drbd/drbd_nl.c |4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a

[PATCH 10/26] drbd: Add struct drbd_resource

2013-12-20 Thread Philipp Reisner
threads of all connections early enough. Signed-off-by: Andreas Gruenbacher Signed-off-by: Philipp Reisner --- drivers/block/drbd/drbd_int.h | 45 +-- drivers/block/drbd/drbd_main.c | 96 +++- drivers/block/drbd/drbd_nl.c | 118

[PATCH 09/26] drbd: Improve some function and variable naming

2013-12-20 Thread Philipp Reisner
igned-off-by: Andreas Gruenbacher Signed-off-by: Philipp Reisner --- drivers/block/drbd/drbd_int.h |8 drivers/block/drbd/drbd_main.c | 32 drivers/block/drbd/drbd_nl.c | 32 drivers/block/drbd/drbd_proc.

<    1   2   3   4   5   >