Re: [PATCH] drbd: fix discard_zeroes_if_aligned regression

2019-05-28 Thread Lars Ellenberg
ng volumes from the > vanilla kernel. If this has already been fixed in something newer than > 4.19, then please point me to the commit. I think it was merged upstream in 5.0 f31e583aa2c2 drbd: introduce P_ZEROES (REQ_OP_WRITE_ZEROES on the "wire") -- : Lars Ellenberg : LIN

[PATCH 16/17] drbd: Avoid Clang warning about pointless switch statment

2018-12-20 Thread Lars Ellenberg
y sent by Arnd Bergmann with a default case statement: https://lore.kernel.org/patchwork/patch/756723/ Link: https://github.com/ClangBuiltLinux/linux/issues/43 Suggested-by: Lars Ellenberg Signed-off-by: Nathan Chancellor --- include/linux/genl_magic_struct.h | 5 - 1 file changed, 4 insertions

[PATCH 17/17] drbd: Change drbd_request_detach_interruptible's return type to int

2018-12-20 Thread Lars Ellenberg
From: Nathan Chancellor Clang warns when an implicit conversion is done between enumerated types: drivers/block/drbd/drbd_state.c:708:8: warning: implicit conversion from enumeration type 'enum drbd_ret_code' to different enumeration type 'enum drbd_state_rv' [-Wenum-conversion]

[PATCH 11/17] drbd: avoid spurious self-outdating with concurrent disconnect / down

2018-12-20 Thread Lars Ellenberg
udate yourself". Try to catch this by checking for current connection status, and possibly retry as local-only state change instead. Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_nl.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/drivers/block/drbd/drbd_n

[PATCH 12/17] drbd: fix print_st_err()'s prototype to match the definition

2018-12-20 Thread Lars Ellenberg
From: Luc Van Oostenryck print_st_err() is defined with its 4th argument taking an 'enum drbd_state_rv' but its prototype use an int for it. Fix this by using 'enum drbd_state_rv' in the prototype too. Signed-off-by: Luc Van Oostenryck Signed-off-by: Roland Kammerer

[PATCH 15/17] drbd: introduce P_ZEROES (REQ_OP_WRITE_ZEROES on the "wire")

2018-12-20 Thread Lars Ellenberg
l, we want to do that, even if our backend does not announce max_write_zeroes_sectors itself. Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_debugfs.c | 2 + drivers/block/drbd/drbd_int.h | 11 +- drivers/block/drbd/drbd_main.c | 11 +- drivers/block/drbd/drbd_nl.c

[PATCH 13/17] drbd: don't retry connection if peers do not agree on "authentication" settings

2018-12-20 Thread Lars Ellenberg
an AuthChallenge, but the peer is not even configured to expect or use a shared secret. Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_receiver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/block/drbd/drbd_receiver.c b/drivers/block/drbd/drbd

[PATCH 14/17] drbd: skip spurious timeout (ping-timeo) when failing promote

2018-12-20 Thread Lars Ellenberg
delaying the error return becomes annoying. Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_nl.c | 15 --- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/drivers/block/drbd/drbd_nl.c b/drivers/block/drbd/drbd_nl.c index 82915880c5e9..bfe1b0062d62 100644 --- a/dri

[PATCH 09/17] drbd: fix comment typos

2018-12-20 Thread Lars Ellenberg
Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_receiver.c | 2 +- drivers/block/drbd/drbd_state.c| 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/block/drbd/drbd_receiver.c b/drivers/block/drbd/drbd_receiver.c index 76d74b2122d6..3a0fe357b68b 100644

[PATCH 06/17] drbd: fix confusing error message during attach

2018-12-20 Thread Lars Ellenberg
ing to attach. It also allows to attach with an explicit size. Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_nl.c | 49 1 file changed, 44 insertions(+), 5 deletions(-) diff --git a/drivers/block/drbd/drbd_nl.c b/drivers/block/drbd/drbd_nl.c

linux-kernel@vger.kernel.org

2018-12-20 Thread Lars Ellenberg
Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_state.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/block/drbd/drbd_state.c b/drivers/block/drbd/drbd_state.c index 0813c654c893..18d53fe60d1d 100644 --- a/drivers/block/drbd/drbd_state.c +++ b/drivers

[PATCH 08/17] drbd: reject attach of unsuitable uuids even if connected

2018-12-20 Thread Lars Ellenberg
asily abort the attach on the peer without more refactoring of the handshake. We now reject any attach to "unsuitable" uuids, as long as we can see a Primary role, unless we already have access to "good" data. Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_nl.c

[PATCH 05/17] drbd: disconnect, if the wrong UUIDs are attached on a connected peer

2018-12-20 Thread Lars Ellenberg
ix is to forcefully disconnect as soon as we notice that the peer attached to the "wrong" dataset. Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_receiver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/block/drbd/drbd_receiver.c b/drivers/block

[PATCH 10/17] drbd: do not block when adjusting "disk-options" while IO is frozen

2018-12-20 Thread Lars Ellenberg
cess). Fix this by skipping the activity log adjustment if the "al-extents" setting did not change. Also, in case it did change, fail early without blocking if it looks like we would block forever. Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_nl.c | 37

[PATCH 04/17] drbd: ignore "all zero" peer volume sizes in handshake

2018-12-20 Thread Lars Ellenberg
nt size, am Primary, and he has the only disk, which is larger than my current size Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_receiver.c | 33 +++--- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/drivers/block/drbd/drbd_receiver.c b

[PATCH 07/17] drbd: attach on connected diskless peer must not shrink a consistent device

2018-12-20 Thread Lars Ellenberg
If we would reject a new handshake, if the peer had attached first, and then connected, we should force disconnect if the peer first connects, and only then attaches. Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_receiver.c | 11 ++- 1 file changed, 6 insertions(+), 5

[PATCH 03/17] drbd: centralize printk reporting of new size into drbd_set_my_capacity()

2018-12-20 Thread Lars Ellenberg
Previously, some implicit resizes that happend during handshake have not been reported as prominently as explicit resize. Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_int.h | 8 +--- drivers/block/drbd/drbd_main.c | 17 - drivers/block/drbd/drbd_nl.c | 3

[PATCH 01/17] drbd: narrow rcu_read_lock in drbd_sync_handshake

2018-12-20 Thread Lars Ellenberg
-> may sleep While using GFP_ATOMIC whould have been possible in the first two cases, the real fix is to narrow the rcu_read_lock. Reported-by: Jia-Ju Bai Reviewed-by: Lars Ellenberg Signed-off-by: Roland Kammerer --- drivers/block/drbd/drbd_receiver.c | 11 ++- 1 file changed, 6 i

[PATCH 00/17] DRBD updates for 4.21

2018-12-20 Thread Lars Ellenberg
quot;. All others are sufficiently simple and supposedly "obvious". Lars Ellenberg (13): drbd: must not use connection after kref_put(&connection->kref) drbd: centralize printk reporting of new size into drbd_set_my_capacity() drbd: ignore "all zero" peer volume

Re: [PATCH v2] drbd: Avoid Clang warning about pointless switch statment

2018-12-18 Thread Lars Ellenberg
On Mon, Dec 17, 2018 at 10:29:38AM -0700, Jens Axboe wrote: > > Hi Lars and Philipp, > > > > Could you please make sure that this patch and the other one I sent make > > it into 4.21/5.0? I am not sure when you were planning on sending the > > pull request to Jens that you mentioned in the other t

Re: [Drbd-dev] [PATCH 28/42] drbd: switch to proc_create_single

2018-05-18 Thread Lars Ellenberg
On Wed, May 16, 2018 at 11:43:32AM +0200, Christoph Hellwig wrote: > And stop messing with try_module_get on THIS_MODULE, which doesn't make > any sense here. The idea was to increase module count on /proc/drbd access. If someone holds /proc/drbd open, previously rmmod would "succeed" in starting

Re: [PATCH] drbd: fix discard_zeroes_if_aligned regression

2018-01-16 Thread Lars Ellenberg
On Mon, Jan 15, 2018 at 11:26:15PM -0800, Christoph Hellwig wrote: > NAK. Calling a discard and expecting zeroing is simply buggy. What he said. The bug/misunderstanding was that we now use zeroout even for discards, with the assumption that it would try to do discards where it can. Which is ev

Re: [PATCH] drbd: standardize kthread/workqueue thread naming to include drbd minor number

2018-01-16 Thread Lars Ellenberg
On Mon, Jan 15, 2018 at 03:52:15PM -0800, Eric Wheeler wrote: > From: Eric Wheeler > > For DRBD resources with long names that start with the same prefix, > it was difficult to find all process pids for that minor since names > are truncated to the task_struct's comm field (16 bytes). > > This p

Re: [PATCH] drbd: rename "usermode_helper" to "drbd_usermode_helper"

2017-06-08 Thread Lars Ellenberg
On Mon, Jun 05, 2017 at 11:26:23AM +0200, Greg KH wrote: > From: Greg Kroah-Hartman > > Nothing like having a very generic global variable in a tiny driver > subsystem to make a mess of the global namespace... > > Note, there are many other "generic" named global variables in the drbd > subsyste

[PATCH] drbd: fix request leak introduced by locking/atomic, kref: Kill kref_sub()

2017-05-11 Thread Lars Ellenberg
those "drbd_requests" does more than just the mempoll_free(). Fixes: bdfafc4ffdd2 ("locking/atomic, kref: Kill kref_sub()") Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_req.c | 27 +++ 1 file changed, 15 insertions(+), 12 deletions(-) diff -

Re: [PATCH] drbd:fix null pointer deref in _drbd_md_sync_page_io

2017-04-26 Thread Lars Ellenberg
On Wed, Apr 26, 2017 at 02:49:37AM -0700, Heloise wrote: > The return value of bio_alloc_drbd can be NULL and is used without No, apparently it cannot, because it is basically a mempool_alloc() with GFP_NOIO, it may sleep, but it will loop "forever" and not return NULL. So rather fix that nonsens

Re: [PATCH] drivers:block:drbd:drbd_state:fix null-pointer dereference

2017-04-25 Thread Lars Ellenberg
On Mon, Apr 24, 2017 at 11:35:18PM -0700, Heloise wrote: > Signed-off-by: Heloise > > In is_valid_state(), there is NULL validation for the variable nc > "if (nc)". However,the code will continue to execute when nc is NULL. > nc->verify_alg[0] is used in subsequent code, which may cause > null-po

Re: [PATCH v2] blk: improve order of bio handling in generic_make_request()

2017-03-10 Thread Lars Ellenberg
On Fri, Mar 10, 2017 at 04:07:58PM +0100, Jack Wang wrote: > On 10.03.2017 15:55, Mikulas Patocka wrote: > > On Fri, 10 Mar 2017, Mike Snitzer wrote: > >> On Fri, Mar 10 2017 at 7:34am -0500, > >> Lars Ellenberg wrote: > >> > >>>> -

Re: [PATCH v2] blk: improve order of bio handling in generic_make_request()

2017-03-10 Thread Lars Ellenberg
> --- a/block/blk-core.c > +++ b/block/blk-core.c > @@ -1975,7 +1975,14 @@ generic_make_request_checks(struct bio *bio) > */ > blk_qc_t generic_make_request(struct bio *bio) > { > - struct bio_list bio_list_on_stack; > + /* > +* bio_list_on_stack[0] contains bios submitted b

Re: blk: improve order of bio handling in generic_make_request()

2017-03-08 Thread Lars Ellenberg
On 8 March 2017 at 17:40, Mikulas Patocka wrote: > > On Wed, 8 Mar 2017, NeilBrown wrote: > > I don't think this will fix the DM snapshot deadlock by itself. > > Rather, it make it possible for some internal changes to DM to fix it. > > The DM change might be something vaguely like: > > > > diff -

Re: blk: improve order of bio handling in generic_make_request()

2017-03-08 Thread Lars Ellenberg
On 7 March 2017 at 17:52, Mike Snitzer wrote: > > On 06.03.2017 21:18, Jens Axboe wrote: > > > I like the change, and thanks for tackling this. It's been a pending > > > issue for way too long. I do think we should squash Jack's patch > > > into the original, as it does clean up the code nicely.

Re: [PATCH] drbd: avoid clang warning about pointless switch statement

2017-02-06 Thread Lars Ellenberg
Ack. Ok, not exactly "pintless", it's a valid compile time assert for uniq ids, basically a BUILD_BUG_ON(duplicate-ids). But adding a default clause there does not hurt. Thanks, Lars On Wed, Feb 01, 2017 at 05:55:02PM +0100, Arnd Bergmann wrote: > The drbd code causes warnings that we canno

Re: [PATCH v2 1/1] block: fix blk_queue_split() resource exhaustion

2017-01-07 Thread Lars Ellenberg
gt; + > r = __clone_and_map_data_bio(ci, ti, ci->sector, &len); > if (r < 0) > return r; > > though I haven't tested, and the change (if it works) should probably be > more fully integrated into surrounding code. > > You probably don&

Re: [PATCH v2 1/1] block: fix blk_queue_split() resource exhaustion

2016-12-23 Thread Lars Ellenberg
ave the time and energy to push it. Thanks for the bump. Lars On 07/11/2016 04:10 PM, Lars Ellenberg wrote: > For a long time, generic_make_request() converts recursion into > iteration by queuing recursive arguments on current->bio_list. > > This is convenient for stack

Re: [Drbd-dev] DRBD: ASSERT in drbd_actlog.c:259

2016-11-14 Thread Lars Ellenberg
scard. > and the kernel (4.4.30) complains: > > block drbd1: ASSERT( (unsigned)(last - first) <= 1 ) in > drivers/block/drbd/drbd_actlog.c:259 see: commit 505675f96cf0f169647a18c3dda1f373eca957b1 Author: Lars Ellenberg Date: Tue Jun 14 00:26:23 2016 +0200 drbd: allow larger ma

[PATCH v2] drbd: Fix kernel_sendmsg() usage - potential NULL deref

2016-11-09 Thread Lars Ellenberg
changed oneliner to be "obvious" without context; more verbose message] Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c index 100be55..8348

Re: [Drbd-dev] [PATCH] drbd: Fix kernel_sendmsg() usage

2016-11-09 Thread Lars Ellenberg
On Wed, Nov 09, 2016 at 04:47:15PM +0100, Richard Weinberger wrote: > > Should I sent two patches, one that applies to 4.5 and later, > > and one that applies to 2.6.33 ... 4.4, or are you or stable > > willing to resolve the trivial "missing comment block" conflict yourself? > > BTW: Why did you

Re: [PATCH] drbd: Fix kernel_sendmsg() usage

2016-11-09 Thread Lars Ellenberg
ndmsg(). > > > > > > Cc: sta...@vger.kernel.org > > > Cc: v...@zeniv.linux.org.uk > > > Cc: christoph.lechleit...@iteg.at > > > Cc: wolfgang.g...@iteg.at > > > Reported-by: Christoph Lechleitner > > > Tested-by: Christoph Lechleitne

Re: [PATCH v2 1/1] block: fix blk_queue_split() resource exhaustion

2016-07-19 Thread Lars Ellenberg
On Tue, Jul 12, 2016 at 10:32:33PM -0400, Mike Snitzer wrote: > On Tue, Jul 12 2016 at 10:18pm -0400, > Eric Wheeler wrote: > > > On Tue, 12 Jul 2016, NeilBrown wrote: > > > > > On Tue, Jul 12 2016, Lars Ellenberg wrote: > > > > > > >

Re: [PATCH 1/1] block: fix blk_queue_split() resource exhaustion

2016-07-11 Thread Lars Ellenberg
Dropped the XXX comment (oops), moved the current_has_pending_bios() helper to bio.h and dropped the identical ones from bio.c and md.h. Reposted in-thread as [PATCH v2 1/1] block: fix blk_queue_split() resource exhaustion Thanks, Lars Ellenberg

[PATCH v2 1/1] block: fix blk_queue_split() resource exhaustion

2016-07-11 Thread Lars Ellenberg
el bios first, and "sibling" bios of the same level in "natural" order. Signed-off-by: Lars Ellenberg Signed-off-by: Roland Kammerer --- block/bio.c | 20 +++ block/blk-core.c | 49 +-

[PATCH 1/1] block: fix blk_queue_split() resource exhaustion

2016-07-08 Thread Lars Ellenberg
el bios first, and "sibling" bios of the same level in "natural" order. Signed-off-by: Lars Ellenberg Signed-off-by: Roland Kammerer --- block/bio.c | 27 + block/blk-core.c | 50 +-

[PATCH 0/1] block: fix blk_queue_split() resource exhaustion

2016-07-08 Thread Lars Ellenberg
Result of RFC previously discussed here: https://lkml.org/lkml/2016/6/22/172 [RFC] block: fix blk_queue_split() resource exhaustion Rebased to linux-block/for-4.8/core as of today. Would also need to go to Stable 4.3 and later. Lars Ellenberg (1): block: fix blk_queue_split() resource

Re: [dm-devel] [RFC] block: fix blk_queue_split() resource exhaustion

2016-07-08 Thread Lars Ellenberg
".recursion", or maybe use something like > ".downstream". "Naming is hard" :-) .recursion and .queue, then, because .remainder does no longer fit. Also, what about "Cc: Stable"? The patch does not strictly fall into the "stable" rules, (too many lines...). But it should go there anyways, I think. I'll just add those tags, and wait for the heat? Lars Ellenberg

Re: [dm-devel] [RFC] block: fix blk_queue_split() resource exhaustion

2016-07-08 Thread Lars Ellenberg
r .incoming, though. > > :-) neither "remainder" or "recursion" seem like brilliant names to me, > but I don't have anything better to suggest. Naming is hard! > As long as a comment explains the name clearly I could cope with X and Y. ... > I think we just might be in violent agreement. I thought so, too :-) Should I merge both patches, rename to ".queue" and ".tmp", and submit for inclusion? Lars Ellenberg

Re: [dm-devel] [RFC] block: fix blk_queue_split() resource exhaustion

2016-07-08 Thread Lars Ellenberg
On Fri, Jul 08, 2016 at 07:08:32PM +0800, Ming Lei wrote: > > So after processing a particular bio, we should then process all the > > 'child' bios - bios send to underlying devices. Then the 'sibling' > > bios, that were split off, and then any remaining parents and ancestors. > > IMHO, that is

Re: [dm-devel] [RFC] block: fix blk_queue_split() resource exhaustion

2016-07-08 Thread Lars Ellenberg
incoming = [ bio(l=2,aa), bio(l=2,ab), ..., bio(l=1,a,remainder), bio(l=1,b), bio(l=1,c), ..., bio(l=0,remainder_1) ] .recursion = [] ... process away ... until back at l=0 .incoming = [ bio(l=0,remainder_1) ] .recursion = [] potentially split further .incoming = [ bio(l=0,now_2), bio(l=0,remainder_2) ] .recursion = [] rinse, repeat. Thanks, Lars Ellenberg

Re: [dm-devel] [RFC] block: fix blk_queue_split() resource exhaustion

2016-07-07 Thread Lars Ellenberg
On Thu, Jul 07, 2016 at 10:16:16AM +0200, Lars Ellenberg wrote: > > > Instead, I suggest to distinguish between recursive calls to > > > generic_make_request(), and pushing back the remainder part in > > > blk_queue_split(), by pointing current->

Re: [RFC] block: fix blk_queue_split() resource exhaustion

2016-07-07 Thread Lars Ellenberg
On Wed, Jul 06, 2016 at 11:57:51PM +0800, Ming Lei wrote: > > my suggestion > > > > generic_make_request(bio_orig) > > NULLin-flight=0 > > bio_origempty in-flight=0 > > qA->make_request_fn(bio_orig) > > blk_queue_split() > > res

Re: [dm-devel] [RFC] block: fix blk_queue_split() resource exhaustion

2016-07-07 Thread Lars Ellenberg
On Thu, Jul 07, 2016 at 03:35:48PM +1000, NeilBrown wrote: > On Wed, Jun 22 2016, Lars Ellenberg wrote: > > > For a long time, generic_make_request() converts recursion into > > iteration by queuing recursive arguments on current->bio_list. > > > > This is conveni

Re: [RFC] block: fix blk_queue_split() resource exhaustion

2016-07-06 Thread Lars Ellenberg
On Mon, Jul 04, 2016 at 06:47:29PM +0800, Ming Lei wrote: > >> One clean solution may be to convert the loop of generic_make_request() > >> into the following way: > >> > >> do { > >> struct bio *splitted, *remainder = NULL; > >> struct request_queue *q = bdev_get_queue(bio->bi_bdev); > >>

Re: [RFC] block: fix blk_queue_split() resource exhaustion

2016-07-04 Thread Lars Ellenberg
On Sat, Jul 02, 2016 at 06:28:29PM +0800, Ming Lei wrote: > The idea looks good, but not sure it can cover all cases of > dm over brbd or brbd over dm and maintaining two lists > becomes too complicated. > > One clean solution may be to convert the loop of generic_make_request() > into the followi

Re: [RFC] block: fix blk_queue_split() resource exhaustion

2016-06-28 Thread Lars Ellenberg
On Sat, Jun 25, 2016 at 05:30:29PM +0800, Ming Lei wrote: > On Fri, Jun 24, 2016 at 10:27 PM, Lars Ellenberg > wrote: > > On Fri, Jun 24, 2016 at 07:36:57PM +0800, Ming Lei wrote: > >> > > >> > This is not a theoretical problem. > >> > At least in

Re: block: fix blk_queue_split() resource exhaustion

2016-06-28 Thread Lars Ellenberg
On Fri, Jun 24, 2016 at 11:15:47AM -0400, Mike Snitzer wrote: > On Fri, Jun 24 2016 at 10:27am -0400, > Lars Ellenberg wrote: > > > On Fri, Jun 24, 2016 at 07:36:57PM +0800, Ming Lei wrote: > > > > > > > > This is not a theoretical problem. > > > &

Re: [RFC] block: fix blk_queue_split() resource exhaustion

2016-06-24 Thread Lars Ellenberg
On Fri, Jun 24, 2016 at 07:36:57PM +0800, Ming Lei wrote: > > > > This is not a theoretical problem. > > At least int DRBD, and an unfortunately high IO concurrency wrt. the > > "max-buffers" setting, without this patch we have a reproducible deadlock. > > Is there any log about the deadlock? And

[RFC] block: fix blk_queue_split() resource exhaustion

2016-06-22 Thread Lars Ellenberg
ack bio-parts resulting from blk_queue_split() will be processed in LIFO order, one-by-one, whenever the recursion list becomes empty. Signed-off-by: Lars Ellenberg Signed-off-by: Roland Kammerer --- This is not a theoretical problem. At least int DRBD, and an unfortunately high IO concurrency wr

Re: [Drbd-dev] [PATCH net-next v3] block/drbd: align properly u64 in nl messages

2016-05-10 Thread Lars Ellenberg
On Tue, May 10, 2016 at 11:39:49AM -0400, David Miller wrote: > From: Lars Ellenberg > Date: Tue, 10 May 2016 11:40:23 +0200 excuse me for reordering the original: > Anyways, back to the topic, can you please just relent and come to > some kind of agreement about the fix for this a

Re: [Drbd-dev] [PATCH net-next v3] block/drbd: align properly u64 in nl messages

2016-05-10 Thread Lars Ellenberg
On Tue, May 10, 2016 at 11:09:53AM +0200, Nicolas Dichtel wrote: > Le 09/05/2016 15:15, Lars Ellenberg a écrit : > > On Mon, May 09, 2016 at 11:40:20AM +0200, Nicolas Dichtel wrote: > [snip] > >> Maybe prefixing genl_magic_func.h and genl_magic_struct.h by 'drbd_' &g

Re: [PATCH net-next v3] block/drbd: align properly u64 in nl messages

2016-05-09 Thread Lars Ellenberg
e interesting so that new module won't use it. What is your > opinion? This was supposed to not be DRBD specific. But it might even still need some massaging before it was truly generic. And obviously, it does not meet the taste of genetlink folks, to say the least :( I don't care either way. Lars Ellenberg

Re: [Drbd-dev] [PATCH net-next v2] block/drbd: use nla_put_u64_64bit()

2016-05-04 Thread Lars Ellenberg
On Wed, May 04, 2016 at 02:49:00PM +0200, Nicolas Dichtel wrote: > Le 04/05/2016 11:05, Lars Ellenberg a écrit : > [snip] > > We don't have an "alignment problem" there, btw. > > Last time I checked, we did work fine without this alignment magic, > > we

Re: [PATCH net-next v2] block/drbd: use nla_put_u64_64bit()

2016-05-04 Thread Lars Ellenberg
On Tue, May 03, 2016 at 12:05:56PM -0400, David Miller wrote: > From: Lars Ellenberg > Date: Tue, 3 May 2016 12:06:44 +0200 > > > Please just NOT use an additional "field", > > but always use 0 to pad. > > You can't, it doesn't work. I did, and it

Re: [PATCH net-next v2] block/drbd: use nla_put_u64_64bit()

2016-05-03 Thread Lars Ellenberg
t always use 0 to pad. Patch is much shorter as well, see below. Attribute type "0" is not used, and will never be of semantic value, but always be ignored in the DRBD netlink family. Whereas using some arbitrary value will be wrong, and will needlessly break userland. Thanks,

Re: [Drbd-dev] [PATCH net-next 0/8] netlink: align attributes when needed (patchset #3)

2016-04-26 Thread Lars Ellenberg
On Tue, Apr 26, 2016 at 01:54:27PM +0200, Lars Ellenberg wrote: > On Tue, Apr 26, 2016 at 10:06:10AM +0200, Nicolas Dichtel wrote: > > > > This is the continuation (series #3) of the work done to align netlink > > attributes when these attributes contain some 64-bit fields. &

Re: [PATCH net-next 0/8] netlink: align attributes when needed (patchset #3)

2016-04-26 Thread Lars Ellenberg
On Tue, Apr 26, 2016 at 10:06:10AM +0200, Nicolas Dichtel wrote: > > This is the continuation (series #3) of the work done to align netlink > attributes when these attributes contain some 64-bit fields. > > It's the last patchset from what I've seen. > > The last user of nla_put_u64() is block/d

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

2016-04-25 Thread Lars Ellenberg
On Mon, Apr 25, 2016 at 02:07:38PM +0200, Philipp Reisner wrote: > + max_discard_sectors = min(q->limits.max_discard_sectors, (1U << 22)); > + max_discard_sectors -= max_discard_sectors % granularity; there On Mon, Apr 25, 2016 at 10:32:17PM +0200, Lars Ellenberg

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

2016-04-25 Thread Lars Ellenberg
On Mon, Apr 25, 2016 at 02:49:11PM -0500, Philipp Reisner wrote: > 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:

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

2016-04-25 Thread Lars Ellenberg
On Mon, Apr 25, 2016 at 09:37:28AM -0700, Bart Van Assche wrote: > On 04/25/2016 05:13 AM, Philipp Reisner wrote: > >+while (nr_sectors >= granularity) { > >+nr = min_t(sector_t, nr_sectors, max_discard_sectors); > >+err |= blkdev_issue_discard(bdev, start, nr, GFP_NOIO,

Re: [PATCH] [RFC] fix potential access after free: return value of blk_check_plugged() must be used schedule() safe

2016-04-06 Thread Lars Ellenberg
On Wed, Apr 06, 2016 at 01:10:57PM +1000, NeilBrown wrote: > On Wed, Apr 06 2016, Shaohua Li wrote: > > > On Tue, Apr 05, 2016 at 03:36:57PM +0200, Lars Ellenberg wrote: > >> blk_check_plugged() will return a pointer > >> to an object linked on current->plug->c

[PATCH] [RFC] fix potential access after free: return value of blk_check_plugged() must be used schedule() safe

2016-04-05 Thread Lars Ellenberg
ber "struct blk_plug_cb cb" at an arbitrary offset? As it is, raid1_check_plugged() below is actually just a cast. Signed-off-by: Lars Ellenberg --- drivers/md/raid1.c | 19 +-- drivers/md/raid10.c | 21 + drivers/md/raid5.c | 5 + fs/btrfs/raid56

Re: [PATCH 03/27] block: drbd: remove impossible failure handling

2016-04-05 Thread Lars Ellenberg
On Tue, Apr 05, 2016 at 07:56:48PM +0800, Ming Lei wrote: > For a non-cloned bio, bio_add_page() only returns failure when > the io vec table is full, but in that case, bio->bi_vcnt can't > be zero at all. > > So remove the impossible failure handling. Before the immutable bvecs, we did in fact s

Re: [PATCH 7/8] block: drbd: avoid to use BIO_MAX_SIZE

2016-03-29 Thread Lars Ellenberg
est way: don't even compile. > Well, getting rid of BIO_MAX_SIZE is worth it, so: > > Reviewed-by: Christoph Hellwig Thanks, Lars Ellenberg

Re: [PATCH] drbd: correctly handling failed crypto_alloc_hash

2016-02-16 Thread Lars Ellenberg
On Mon, Feb 15, 2016 at 09:26:25PM -0500, Insu Yun wrote: > crypto_alloc_hash returns an error code, not NULL. You are correct, of course. Was broken since its introduction five years ago. Strange though, we have a helper function further down in that file, and other, even much older, call sites a

Re: [DRBD-user] [PATCH] tree wide: Use kvfree() than conditional kfree()/vfree()

2015-11-10 Thread Lars Ellenberg
On Mon, Nov 09, 2015 at 08:56:10PM +0900, Tetsuo Handa wrote: > There are many locations that do > > if (memory_was_allocated_by_vmalloc) > vfree(ptr); > else > kfree(ptr); > > but kvfree() can handle both kmalloc()ed memory and vmalloc()ed memory > using is_vmalloc_addr(). Unless cal

Re: [PATCH] drbd: Support zeroout device instead of initial full sync

2015-08-18 Thread Lars Ellenberg
, # drbdadm resize ... --assume-clean ... No need to touch either the DRBD module, or the DRBD utils at all. All there already. Lars Ellenberg -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org

Re: [Drbd-dev] [PATCH 00/10] Zero out devices instead of initial full sync

2015-06-10 Thread Lars Ellenberg
without taking up any real network bandwidth. In short: I don't see the point. Lars Ellenberg -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/

Re: [Drbd-dev] [PATCH] block:drbd:drbd_receiver - Change 1/0 to true/false for bool type variable rv in function overlapping_resync_write().

2015-05-27 Thread Lars Ellenberg
On Tue, May 26, 2015 at 01:45:09AM +0530, Shailendra Verma wrote: > In function overlapping_resync_write() variable rv is bool type. > Hence assigning the values as true/false instead of 1/0. I like 0 and 1 better. So unless the powers that be rule this to be the recommended or mandatory coding s

Re: [Drbd-dev] [PATCH] drbd: use bitmap_weight()

2015-03-20 Thread Lars Ellenberg
t;, I disagree. I think it is more cpu cache friendly to hweight_long then set to ~0UL each word in turn, than to first bitmap_weight() all words, then bitmap_fill() all words. Thanks, Lars Ellenberg BTW, you swapped names and email addresses of phil and me. Are those listed incorrectly s

Re: [DRBD-user] [patch 1/2] block, drbd: fix drbd_req_new() initialization

2015-03-10 Thread Lars Ellenberg
ze it to 0. We used to have the explicit memset there, but then changed that, because I was under the impression that since 2007-07-17 d07dbea, Slab allocators: support __GFP_ZERO in all allocators it was supported? Lars Ellenberg -- To unsubscribe from this list: send the line &qu

Re: [DRBD-user] FIX MEs for spinlocks in drbd_worker.c

2014-11-22 Thread Lars Ellenberg
On Thu, Nov 20, 2014 at 05:37:19PM -0500, nick wrote: > Greetings Lars, > I am wondering about removing the spin locks around the linked list > operators in worker.c or do we need to test it first it first on > actual hardware. > Cheers Nick Unless you have deep insight in the inner workings of DR

Re: [PATCH v2] drbd: fix throttling on newly created DM backing devices

2014-09-04 Thread Lars Ellenberg
l need to review if the ->ldev->backing_bdev-> ... deref is always safe to do. But I think it is. commit c90cac67d6c12dcf3945f67a28718c40b644cc32 Author: Lars Ellenberg Date: Thu Sep 4 13:15:45 2014 +0200 drbd: fix resync throttling initialization If for some reason DRBD resync was the only activity

Re: [PATCH] drbd: fix throttling on newly created DM backing devices

2014-09-03 Thread Lars Ellenberg
to properly initialize rs_last_events instead. I'll think about that... Lars Ellenberg > Reported-by: Mikhail Sugakov > Cc: Matt Wilson > Signed-off-by: Imre Palik > --- > drivers/block/drbd/drbd_receiver.c |3 ++- > 1 file changed, 2 insertions(+), 1 deletio

Re: [Drbd-dev] [PATCH v2] drbd: change one-bit bitfield to be an unsigned int

2014-06-17 Thread Lars Ellenberg
On Tue, Jun 17, 2014 at 08:54:07AM +0200, Martin Kepplinger wrote: > The one-bit bitfields are assigned true (1) or false (0) and checked > for them respectively. While it should work either way and -1 is true > as well it is more clear to see what's going on when using an unsigned int > because 1

Re: [drbd] Kernel panic - not syncing: Out of memory and no killable processes...

2014-03-18 Thread Lars Ellenberg
11:43 +0800 | From: Fengguang Wu | To: Philipp Reisner , drbd-u...@lists.linbit.com, linux-kernel@vger.kernel.org | Subject: Re: [drbd?] Kernel panic - not syncing: Out of memory and no killable processes... | Message-ID: <20130612101143.GA13837@localhost> | | On Tue, Jun 11, 2013 at 05:33:27

Re: [PATCH] bcache: fix NULL pointer deref in blk_add_request_payload

2014-02-19 Thread Lars Ellenberg
On Wed, Feb 19, 2014 at 01:07:14PM +, Lars Ellenberg wrote: > bch_generic_make_request_hack() tries to be smart, > and fake a bi_max_bvecs = bi_vcnt. I meant to include a cover letter with the Oops backtrace, and this: Note that this patch is relevant for 3.13 and before. With 3.14

[PATCH] bcache: fix NULL pointer deref in blk_add_request_payload

2014-02-19 Thread Lars Ellenberg
blk_add_request_payload, which then tries to use bio->bi_io_vec->page. Fix: try to be even smarter in bch_generic_make_request_hack(), and always pretend to have at least bi_max_vecs of 1, unless the incoming bio was already created without a single bvec. Signed-off-by: Lars Ellenberg --- drivers/md/bcach

Re: [drbd?] Kernel panic - not syncing: Out of memory and no killable processes...

2013-06-11 Thread Lars Ellenberg
e the hard limit for the number of minor devices (allocation of an array of corresponding size), that has long since changed, and now it is really only used as scaling factor for these mempools. Lars -- : Lars Ellenberg : LINBIT | Your Way to High Availability : DRBD/HA support and co

Re: [PATCH 3.9-stable ]drbd: fix for deadlock when using automatic split-brain-recovery

2013-05-14 Thread &#x27;Lars Ellenberg'
09-06-10 "Fixed a deadlock when using automatic split brain recovery when > > both nodes are" > > replacing drbd_set_role() with drbd_change_state() in that code-path, > > but the first hunk of that patch forgets to remove the drbd_set_role(). > > > > We app

Re: [PATCH 3.9-stable] drbd: Fix build error when CONFIG_CRYPTO_HMAC is not set

2013-05-14 Thread &#x27;Lars Ellenberg'
> > > > -- > > > > From: "Philipp Reisner " > > > > commit ef57f9e6bb9278720c8a5278728f252ab85d7ac6 upstream > > > > Signed-off-by: Philipp Reisner > > Signed-off-by: Lars Ellenberg > > Signed-off-by: Jens

Re: [Drbd-dev] [PATCH] drivers/block/drbd: remove erroneous semicolon

2013-04-09 Thread Lars Ellenberg
On Tue, Apr 09, 2013 at 09:22:40AM +0800, Chen Gang wrote: > On 2013年04月09日 04:45, Lars Ellenberg wrote: > > On Wed, Apr 03, 2013 at 04:00:31PM +0800, Chen Gang wrote: > >> > Hello maintainers: > >> > > >> > when you have time,

Re: [PATCH] drivers/block/drbd: remove erroneous semicolon

2013-04-08 Thread Lars Ellenberg
On Wed, Apr 03, 2013 at 04:00:31PM +0800, Chen Gang wrote: > Hello maintainers: > > when you have time, please help to check this patch whether is OK. > > thanks. Thanks. It has already been queued in: http://git.kernel.dk/?p=linux-block.git;a=commit;h=0b6ef4164f50698eee536903d69d086add1a78

Re: [Drbd-dev] [PATCH -next] drbd: fix error return code in drbd_init()

2013-04-04 Thread Lars Ellenberg
On Thu, Apr 04, 2013 at 02:17:09PM +0800, Wei Yongjun wrote: > From: Wei Yongjun > > Fix to return a negative error code from the error handling > case instead of 0, as returned elsewhere in this function. We used to have an err = -ENOMEM; "just in case"... How about this instead: diff --git a

Re: [Drbd-dev] [PATCH 10/18, update] drbd: prepare to queue write requests on a submit worker

2013-03-22 Thread lars . ellenberg
From: Lars Ellenberg Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_int.h | 13 + drivers/block/drbd/drbd_main.c | 26 +- drivers/block/drbd/drbd_nl.c |1 + drivers/block/drbd/drbd_req.c | 29

Re: [Drbd-dev] [PATCH 00/18] RFC: Non blocking submit for activity log misses

2013-03-22 Thread lars . ellenberg
On Fri, Mar 22, 2013 at 11:17:06AM -0600, Jens Axboe wrote: > On Tue, Mar 19 2013, Philipp Reisner wrote: > > This patch series improves DRBD's behavior. A submitter is no longer blocked > > in the case of a AL-miss. For this a dedicated submitter worker is > > introduced > > (patch 13). > Patch

Re: [Drbd-dev] linux-next: Tree for Feb 23 (drbd)

2013-03-01 Thread Lars Ellenberg
On Mon, Feb 25, 2013 at 11:28:03AM -0800, Randy Dunlap wrote: > On 02/24/13 21:00, Stephen Rothwell wrote: > > Hi all, > > > > Please do not add any work destined for v3.10 to your -next included > > branches until after Linus has release v3.9-rc1. > > > > Changes since 20130222: > > > > > on

Re: linux-next: build warnings after merge of the akpm tree

2012-11-28 Thread Lars Ellenberg
d to a BUG()") from the block tree and commit > "wait: add wait_event_lock_irq() interface" from the akpm tree. Thanks. We can just drop our copy-n-paste-from-md.h then. Lars --- commit 2712ab592def9f0171b6d47349879e975db57657 Author: Lars Ellen

Re: [RFC] [PATCH] fix infinite loop; increase robustness of debugfs_remove_recursive [attached test module]

2012-11-28 Thread Lars Ellenberg
On Wed, Nov 28, 2012 at 10:37:54AM +0100, Lars Ellenberg wrote: > Note that all but rmmod may be done as normal user, Ok, that is not exactly correct, I forgot about debugfs being mounted 0700 ;-) Still... Lars -- To unsubscribe from this list: send the line "unsubscribe linu

Re: [RFC] [PATCH] fix infinite loop; increase robustness of debugfs_remove_recursive [attached test module]

2012-11-28 Thread Lars Ellenberg
On Tue, Nov 27, 2012 at 10:16:28PM -0500, Steven Rostedt wrote: > On Fri, 2012-11-23 at 18:15 +0100, Lars Ellenberg wrote: > > When toying around with debugfs, intentionally trying to break things, > > I managed to get it into a reproducible endless loop w

[RFC] [PATCH] fix infinite loop; increase robustness of debugfs_remove_recursive

2012-11-23 Thread Lars Ellenberg
When toying around with debugfs, intentionally trying to break things, I managed to get it into a reproducible endless loop when cleaning up. debugfs_remove_recursive() completely ignores that entries found on ->d_subdirs may already be d_delete()d, but not yet d_kill()ed. In this case, the firs

Re: [PATCH v3 06/26] block: Add bio_end_sector()

2012-09-26 Thread Lars Ellenberg
On Tue, Sep 25, 2012 at 03:06:24PM -0700, Kent Overstreet wrote: > On Tue, Sep 25, 2012 at 01:54:52PM +0200, Lars Ellenberg wrote: > > On Mon, Sep 24, 2012 at 03:34:46PM -0700, Kent Overstreet wrote: > > > Just a little convenience macro - main reason to add it now is preparing &

Re: [Drbd-dev] [PATCH v3 06/26] block: Add bio_end_sector()

2012-09-25 Thread Lars Ellenberg
On Mon, Sep 24, 2012 at 03:34:46PM -0700, Kent Overstreet wrote: > Just a little convenience macro - main reason to add it now is preparing > for immutable bio vecs, it'll reduce the size of the patch that puts > bi_sector/bi_size/bi_idx into a struct bvec_iter. For the DRBD part: > diff --git a

  1   2   >