Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2438918imj; Mon, 18 Feb 2019 06:06:14 -0800 (PST) X-Google-Smtp-Source: AHgI3IZjn7p+mxGy27xRKOMBsWl/g1mup6hyK8XsE0GIykJ0DSmJ96tP4z7IQb/KVwz/vIp+sAHN X-Received: by 2002:a63:d4f:: with SMTP id 15mr12628311pgn.162.1550498774033; Mon, 18 Feb 2019 06:06:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550498774; cv=none; d=google.com; s=arc-20160816; b=IJbdJklVkUqqZ4koAnPxgVkW0FB+BSMRZIkXnsK64Bs8FAVQ7zcPIG+Qt9q3XamLCv TI/qWDRoLFLan9O2g4/SoNE8YmdIyC2nV+2uxcfL/U6LpKOSz7xCMHxy1QmHTV8NV9SF IbTpoFsGEe+mRAkg9/+KRDMj9YxeTXf/M9kVUjyB/85nCspEg/5PPgkrxc3fjKfsAnT3 CYXGjqt+PTsU56T6zwB2t0/4Bab0Nopo7kHwOIuOWZr8f+JGpg3BT3tfXqxyTC9Lyik5 /0kmidxqEk5lc6ngd49uUsWzQV0roy5Odne1M4e/JwGu1QK/9cikEACu1t0CqDQPSQtE Ck7w== 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=UWmk6e2taOw0nAafUjpggSNP9kbWfEMMkIDSJghEVRI=; b=zxcSYmKVMLBanS5b5v9nh7kRS9x2eNKjI3BnahR8vnk6yYZCirZA7KmZhrpYJpwdI0 qHmrC/FsRukrtjou0ctnEho7A99iU+7z541mAx/Ec8asQT2gFI4V/iGVgJ7c4bi1u3wr nWBnhFqngpxiRGPRGinE/u75ilBDUlULo5FQONFsnNwrMoM8Jhpm1QplG5P9CiVS7Iam JOcgCuif/GhX9ehkChQhiD8ynXS1hRu6I74erewmQRwKz6kfT8H7v2AUeB54LXFLQMKH uKaX7cpo1gyHwtcDP00M+7lp+G0nrPnt9eJcIxtuiTt2J1jB28KhswKte8kovdPe/uIs kNAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=SPcKMs8Z; 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 33si13956649plh.245.2019.02.18.06.05.58; Mon, 18 Feb 2019 06:06:14 -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=SPcKMs8Z; 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 S2389794AbfBRODz (ORCPT + 99 others); Mon, 18 Feb 2019 09:03:55 -0500 Received: from mail.kernel.org ([198.145.29.99]:45828 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389747AbfBRODt (ORCPT ); Mon, 18 Feb 2019 09:03:49 -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 3BF5421901; Mon, 18 Feb 2019 14:03:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1550498628; bh=/UTDyh4bxb+avqeHerWYgOLWfBPtnB2lxuQYeX2QYTY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SPcKMs8Zyhb9tAniukqVpPZs6IQHW6Z117k8sTwqSLVg5ZGzodq9ZdKJAY/N3r50E vUBwbWVOv6freiN7HOXIThpB5KVB0vP9sQrVjYZbW8anwPRkSA11av0yUGqEzyOvm9 4a1lye2WRXEeskbfd0+pgWqmCN7rDx2yTzYhtLvQ= 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.4 047/143] drbd: disconnect, if the wrong UUIDs are attached on a connected peer Date: Mon, 18 Feb 2019 14:42:55 +0100 Message-Id: <20190218133530.853979222@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190218133529.099444112@linuxfoundation.org> References: <20190218133529.099444112@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.4-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 2fedab9349f6..b1ee358edd3b 100644 --- a/drivers/block/drbd/drbd_receiver.c +++ b/drivers/block/drbd/drbd_receiver.c @@ -3890,7 +3890,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