Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp2479259ybi; Sat, 1 Jun 2019 17:30:50 -0700 (PDT) X-Google-Smtp-Source: APXvYqw7wM3fLw/VlnhTjvaqPQ5ujxBumSnd5mKVcXIubHrTky/vb/lDGrdjwFcWP7G9qm4cDIhe X-Received: by 2002:a62:e10f:: with SMTP id q15mr20361573pfh.56.1559435450210; Sat, 01 Jun 2019 17:30:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559435450; cv=none; d=google.com; s=arc-20160816; b=vL/QuNJFAB/od6whAT2SMpTeOXfoX8+YoFQ4zfhqk7XrpE9Y46DiidHDmZ8KLnSZpS rjw8X2JaJXgBBJRnKCgghPHxKBntvPVU4hh1ZilfaYcbFw22HAW++Y+jhIWHcgvyL167 qxa2J3FV6Uca2WM1JNoyhAdTICwkyBYiHvHV97IanmeklNbFnXhUrFk3dMZJk6MW4SLx fwmwcF1jW4ulVv9qj3LlSc+YlaUBDuhSqMUb4PCttsM1Ax+GSYjeMjxP5C2ALE1Dj8Wq QjTtvBt1wI6ghZupuJ3Ru+PS64fLlb/fXTqaCAukyJcMQQXd7WD7Tpeym/LuzebMIcI/ dX6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=wrWsueGV9+jbe4isP291ZtwZUrdVi0nZKeAKFEwXonI=; b=FHWdRNIEsVbv6c4KzX11QiI/Iucly8ARlDvSqpRcynwEjDuRSHdDPoMv6q6JJgg8Km n7IrOxtK0XId4Z4YRyTmdniRTIrXJ8K4ANlUKV3RJskV7vyVxkV0I80awQhlsZ7dgu8/ q+O+GII3FIuW5yGajGeBFlo/WZdgZjO5p1sjnM2CCWV+umS3SbuvDMLA/dq/nmtWbZFs BwVTHmLrDhg3DlpyRQsikjqi6ZdNWrNpAcBLkElzKWGCBDCz1FRBPpwEiwPkH2DILCDY lA975+SR1zYOp1pVypzEsfAuk/b7Ke82Fc1yywibpR2pH/TDH7Y027OgYIA4WKsfDxlU ImLQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c137si13937308pfb.185.2019.06.01.17.30.21; Sat, 01 Jun 2019 17:30:50 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726616AbfFBA2e (ORCPT + 99 others); Sat, 1 Jun 2019 20:28:34 -0400 Received: from mx.ewheeler.net ([66.155.3.69]:33506 "EHLO mx.ewheeler.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726211AbfFBA2d (ORCPT ); Sat, 1 Jun 2019 20:28:33 -0400 Received: from localhost (localhost [127.0.0.1]) by mx.ewheeler.net (Postfix) with ESMTP id B8A46A0692; Sun, 2 Jun 2019 00:28:32 +0000 (UTC) X-Virus-Scanned: amavisd-new at ewheeler.net Received: from mx.ewheeler.net ([127.0.0.1]) by localhost (mx.ewheeler.net [127.0.0.1]) (amavisd-new, port 10024) with LMTP id W-A0Bg48Fkrc; Sun, 2 Jun 2019 00:28:31 +0000 (UTC) Received: from mx.ewheeler.net (mx.ewheeler.net [66.155.3.69]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx.ewheeler.net (Postfix) with ESMTPSA id C446BA067D; Sun, 2 Jun 2019 00:28:31 +0000 (UTC) Date: Sun, 2 Jun 2019 00:28:31 +0000 (UTC) From: Eric Wheeler X-X-Sender: lists@mx.ewheeler.net To: Lars Ellenberg cc: drbd-dev@lists.linbit.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH] drbd: fix discard_zeroes_if_aligned regression In-Reply-To: <20190528131823.GD5803@soda.linbit> Message-ID: References: <15124635.GA4107@soda.linbit> <1516057231-21756-1-git-send-email-drbd-dev@lists.ewheeler.net> <20180116072615.GA3940@infradead.org> <20180116094907.GD4107@soda.linbit> <20190528131823.GD5803@soda.linbit> User-Agent: Alpine 2.11 (LRH 23 2013-08-11) MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="-1690155773-127689699-1559435311=:27699" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. ---1690155773-127689699-1559435311=:27699 Content-Type: TEXT/PLAIN; charset=iso-8859-1 Content-Transfer-Encoding: 8BIT On Tue, 28 May 2019, Lars Ellenberg wrote: > On Fri, May 10, 2019 at 05:36:32PM +0000, Eric Wheeler wrote: > > Hi Lars, > > > > We just tried 4.19.x and this bugs still exists. We applied the patch > > which was originally submitted to this thread and it still applies cleanly > > and seems to work for our use case. You mentioned that you had some older > > code which zeroed out unaligned discard requests (or perhaps it was for a > > different purpose) that you may be able to use to patch this. Could you > > dig those up and see if we can get this solved? > > > > It would be nice to be able to use drbd with thin backing 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") Thanks Lars, I appreciate your patch. Your unaligned zerout code in drbd_issue_discard_or_zero_out() looks great. I particulary like how you adjusted max_discard_sectors to the granularity, as well as alignment handling. Well thought out. Your commit notes that "for backward compatibility, P_TRIM means zero-out, unless the DRBD_FF_WZEROES feature flag is agreed upon during handshake." We test our environment by deploying the newer kernel on one of the DRBD servers and checking for regressions---but this will cause a zero-out on the new server because the old server doesn't yet support DRBD_FF_WZEROES. For our purpose, can you think of any reason that it would be unsafe to hack the following into drbd_do_features() so the newer version will not zero-out while we test and get both nodes up to the newer version? diff --git a/drivers/block/drbd/drbd_receiver.c b/drivers/block/drbd/drbd_receiver.c index c7ad88d..76191e6 100644 --- a/drivers/block/drbd/drbd_receiver.c +++ b/drivers/block/drbd/drbd_receiver.c @@ -5382,6 +5382,8 @@ static int drbd_do_features(struct drbd_connection *connection) connection->agreed_pro_version = min_t(int, PRO_VERSION_MAX, p->protocol_max); connection->agreed_features = PRO_FEATURES & be32_to_cpu(p->feature_flags); + connection->agreed_features |= DRBD_FF_WZEROES; + drbd_info(connection, "Handshake successful: " "Agreed network protocol version %d\n", connection->agreed_pro_version); -- Eric Wheeler > > -- > : Lars Ellenberg > : LINBIT | Keeping the Digital World Running > : DRBD -- Heartbeat -- Corosync -- Pacemaker > : R&D, Integration, Ops, Consulting, Support > > DRBD? and LINBIT? are registered trademarks of LINBIT > ---1690155773-127689699-1559435311=:27699--