Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9105679pxu; Mon, 28 Dec 2020 06:46:57 -0800 (PST) X-Google-Smtp-Source: ABdhPJxWWGgK5sltaLPimUnBRihRb2I/I7w9e+72vNKiCYcuSqiixzBFtNsfKtUnMPLwybNwS0wv X-Received: by 2002:a05:6402:50cf:: with SMTP id h15mr33037747edb.149.1609166817411; Mon, 28 Dec 2020 06:46:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609166817; cv=none; d=google.com; s=arc-20160816; b=sBfVdEKJRXw413Mz2OPCBq14iCwJG9B9QQOea6jvrJToy7qpE7G0fnzoo/RVcPuQNM ySE3UjZBFivGc8WTf3Wml4hzJhKA23aTU8znq6MhQ2uj4+4BHzOQ0iloAvh7p/im+u4m LmkYWChVOD0b93aTZKdhlbDxfCNx5ToYmsDq9bu0ui6XOwc78h90ITxYqIlkGwUAL+9T K/M8St9z1E5mOTbSwopCaXPez+D3oR6dqkqxvphKWvB4qj9Bf2GLi0emiyENHVNm447T 4guQjpKoMoMemKXYxCdm9bm4pfKKxiJKXabRWSbceTkNdfeJRIfrPOIfCi3/ouY8qMca UHEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=mQJxyL2xcaRzRdXOXhakzzgOEisfxUAAZ38qrXNuM8E=; b=G2s+JBQ1O1lckYJTRYBdQhYIHLYeSjha7hUBC2O/Jp9W8CurbY80e0YoTldnL9P0n7 0wA6RMStO7Yl6fqCLMRD/D1MbCWxszJ801xRb3FGySFhNNA81SEJHtawPXZBpMqrFJf6 43DpquCryl9g/zTzWctByAJJAVvKE3I6kCMfpGNzT1kDCTzE76rCXbjhTfHlvov4ItGz zO0n4z0rRhbUB/Lw88J6bcTkyarilvjtJz8C1n3CuF5iL6Thwy01ALSZYDiJEma3rLHH 8R9OXBnbTpeXGO6sAleMrWWegtIt6B8smh6sAerM9sfN/q1FP1AEepbVTCCie8/UBf3K msCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=VjqyHDH9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cz27si19297427edb.371.2020.12.28.06.46.34; Mon, 28 Dec 2020 06:46:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=VjqyHDH9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2503204AbgL1OZ0 (ORCPT + 99 others); Mon, 28 Dec 2020 09:25:26 -0500 Received: from mail.kernel.org ([198.145.29.99]:60270 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2392074AbgL1OZV (ORCPT ); Mon, 28 Dec 2020 09:25:21 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7890920791; Mon, 28 Dec 2020 14:25:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609165506; bh=68WcUA4SCIq5euYBlkcE9hSO8wqkCfcl9VXdHARhno0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VjqyHDH9+5+orkt911zLGAFjmxKtWZb0qEiY8Jn/s0MO8W9DLFLz+rMCn6UF+EAEw X+HIxC0yTpsOXuEoibYcM52fK/Q9YC1uBUPYJaPg2vt+KvZ4TdLH3/JmfMIHZFSG5o ddPDpnTO/edF0ue46S3rijZ7KQwVaB7E1fXACJM4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Stefan Haberland , Jan Hoeppner , Jens Axboe Subject: [PATCH 5.10 556/717] s390/dasd: prevent inconsistent LCU device data Date: Mon, 28 Dec 2020 13:49:14 +0100 Message-Id: <20201228125047.570920649@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228125020.963311703@linuxfoundation.org> References: <20201228125020.963311703@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Stefan Haberland commit a29ea01653493b94ea12bb2b89d1564a265081b6 upstream. Prevent _lcu_update from adding a device to a pavgroup if the LCU still requires an update. The data is not reliable any longer and in parallel devices might have been moved on the lists already. This might lead to list corruptions or invalid PAV grouping. Only add devices to a pavgroup if the LCU is up to date. Additional steps are taken by the scheduled lcu update. Fixes: 8e09f21574ea ("[S390] dasd: add hyper PAV support to DASD device driver, part 1") Cc: stable@vger.kernel.org Signed-off-by: Stefan Haberland Reviewed-by: Jan Hoeppner Signed-off-by: Jens Axboe Signed-off-by: Greg Kroah-Hartman --- drivers/s390/block/dasd_alias.c | 9 +++++++++ 1 file changed, 9 insertions(+) --- a/drivers/s390/block/dasd_alias.c +++ b/drivers/s390/block/dasd_alias.c @@ -511,6 +511,14 @@ static int _lcu_update(struct dasd_devic return rc; spin_lock_irqsave(&lcu->lock, flags); + /* + * there is another update needed skip the remaining handling + * the data might already be outdated + * but especially do not add the device to an LCU with pending + * update + */ + if (lcu->flags & NEED_UAC_UPDATE) + goto out; lcu->pav = NO_PAV; for (i = 0; i < MAX_DEVICES_PER_LCU; ++i) { switch (lcu->uac->unit[i].ua_type) { @@ -529,6 +537,7 @@ static int _lcu_update(struct dasd_devic alias_list) { _add_device_to_lcu(lcu, device, refdev); } +out: spin_unlock_irqrestore(&lcu->lock, flags); return 0; }