Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2656078imj; Mon, 11 Feb 2019 06:33:41 -0800 (PST) X-Google-Smtp-Source: AHgI3IYdMq4zd1WTcuoNjoIYYQNuhFopz67/fmyLsDnLhb+PGSdNe3HLwYPplJGDQ8o7ZrbQLKiz X-Received: by 2002:a62:5b44:: with SMTP id p65mr36488625pfb.47.1549895621067; Mon, 11 Feb 2019 06:33:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549895621; cv=none; d=google.com; s=arc-20160816; b=R6dqgYKWV33WjZnAvETbClsI8wUCJGRQGxWx0nwXlfIYuGOTwA6IHilodlOsUi9op3 VgtsKLNMgsfJSkKkmr+taGOWfR2R//MVqgCxkKIBUo2JI1UEuXKMRpeLm0xn9h5/GuIS mOx5P6FVOZy2q0g5jxMIs/JXtnSqo9NRNal++JZtRYh9OYBJjVyCbYum9qC0gNNJkuZq thaPDAk7W/naQP7u40b5eqbVNqB/r7SmYGuVJzF5qXUZoCTlNN5sYZKPTiN8Z9B6gWJ4 dB7BPT28Td0mEKdyG0DBtLWrEtVZMZRD3Ie18q6MUAnJ7mk+9f/CjHTQVWZXOqb3EKJL Nbfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=QyB7fNbdAbGl4gWSFxgRLpR5c/+rhybMuGbCIhmPakE=; b=ydLaG5jnuX0heHtFrrpNDt+Gsa3BgxJypbMDbFYSGcR1eDCgrhbt9zvqQ+HUXT/flD Oh5qtwdZ5hU33qnAJRc3wCbtRZZqrRUbLXwySOMMUduhDOhbddDT3AsfOIhJDyLqgZEB UDrXEYa1WsGNrwV8WuEU4g8E2bD/aggPnXhQWCqSo9sckAAzlKwqnGOpIR9X8NtDfMSV 50N+krHcpzmuW3EHkXXSGCJIfQkga7rxvIILSkl3qiCJHMJgr2J4UEwtsFe4BGX3XE6j EpZdc7XOk+DEkHdJBKBKchO/k0TCM3J43/9zKSTcp32RGkOB3wz4r3V4gGYjZU/xkYvP Xf3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=VPOgZuit; 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 98si10945424pla.320.2019.02.11.06.33.25; Mon, 11 Feb 2019 06:33:41 -0800 (PST) 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; dkim=pass header.i=@kernel.org header.s=default header.b=VPOgZuit; 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 S1730367AbfBKObq (ORCPT + 99 others); Mon, 11 Feb 2019 09:31:46 -0500 Received: from mail.kernel.org ([198.145.29.99]:38728 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730346AbfBKObl (ORCPT ); Mon, 11 Feb 2019 09:31:41 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8654520844; Mon, 11 Feb 2019 14:31:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549895501; bh=zLHrc2OzcgeA1w0N76dq/vN6TewAHJFZk5jmeVT6vCg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VPOgZuit918HOSqEPFkU/jlO6OIb96oMnVn542QjEad7CtUkMmCQlUvGM3K3u475v HpuCTZWe0s9obE1p4RoJLQ4pMXi55ta+PhpwbstGAod1mJ5ZuKMPX8NugyoMvPR10G wWdrP0vQPelZCTfxragC3yIa9KIsWmDuyjtoTFGA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Lars Ellenberg , Jens Axboe , Sasha Levin Subject: [PATCH 4.20 226/352] drbd: disconnect, if the wrong UUIDs are attached on a connected peer Date: Mon, 11 Feb 2019 15:17:33 +0100 Message-Id: <20190211141901.611942537@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190211141846.543045703@linuxfoundation.org> References: <20190211141846.543045703@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.20-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit b17b59602b6dcf8f97a7dc7bc489a48388d7063a ] With "on-no-data-accessible suspend-io", DRBD requires the next attach or connect to be to the very same data generation uuid tag it lost last. If we first lost connection to the peer, then later lost connection to our own disk, we would usually refuse to re-connect to the peer, because it presents the wrong data set. However, if the peer first connects without a disk, and then attached its disk, we accepted that same wrong data set, which would be "unexpected" by any user of that DRBD and cause "undefined results" (read: very likely data corruption). The fix is to forcefully disconnect as soon as we notice that the peer attached to the "wrong" dataset. Signed-off-by: Lars Ellenberg Signed-off-by: Jens Axboe Signed-off-by: Sasha Levin --- 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_receiver.c index 1b9822f264d2..e3da52b524d3 100644 --- a/drivers/block/drbd/drbd_receiver.c +++ b/drivers/block/drbd/drbd_receiver.c @@ -4143,7 +4143,7 @@ static int receive_uuids(struct drbd_connection *connection, struct packet_info kfree(device->p_uuid); device->p_uuid = p_uuid; - if (device->state.conn < C_CONNECTED && + if ((device->state.conn < C_CONNECTED || device->state.pdsk == D_DISKLESS) && device->state.disk < D_INCONSISTENT && device->state.role == R_PRIMARY && (device->ed_uuid & ~((u64)1)) != (p_uuid[UI_CURRENT] & ~((u64)1))) { -- 2.19.1