Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2555252lqp; Mon, 25 Mar 2024 02:25:51 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVw0siGaWo3pMYNYz9sB66PwphKZXJSe1Wbnbkdg2a45qgHg03psJ19AEL/jI1BqGN0Y4HHuzQH2tDnW3pGIBTBCwHIX653V74ENRtCuA== X-Google-Smtp-Source: AGHT+IEUIqpkeMP8VlsnBOJf7iCgh8pZyNEa3amjRb/mWLDyYtPN6sW80/gzazmdNfqBEUcT+HsM X-Received: by 2002:a05:6870:f616:b0:22a:1cd5:dc5 with SMTP id ek22-20020a056870f61600b0022a1cd50dc5mr4846238oab.20.1711358750791; Mon, 25 Mar 2024 02:25:50 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711358750; cv=pass; d=google.com; s=arc-20160816; b=SCPgnl8BD/KSom/bgsWB+7HofD1eY/EYK1hwOvInZBIsOiIoTfgMcbITmCPwKjmNhI z8NEkYXsCzpNa+86n5nT8jxL7dKeDGWWtIRCPg+XzsBt99jXqsr6PyBw1f1FutD/ag4Q 2d0fvqvmdXye12XbhrtwwfsZyInfpVPfdDK8Nxf7ZzwchiSdRUyk3qNUkQqd9zSP0BW3 pk/EAHeQr00D/VVNxrJPwcicmhu1RxBku/+njivhQND2eknVtT5xYup0hARgDDulnpYh 0PWLHZuyc1WJRr9e8wIeKkAK1HR+hlw4XSslhg+YLQfymNTTH35LJWNBH4u9fxYI8IDw JcXg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=gZ7zSM8JXCAE1fRSfN5y9X5nmg+r7NaE2szWa3ID9KY=; fh=++kMUPzojOevoFPqkAYcEUA3ExBjQzAARDRdPEpA+nE=; b=niKQFmnKAnUoi6bUU32LtQUbbOR1yn30+k/3SugaFP8E+vRx2xg36Ytzj8nsBQo+NO 3QP3FJFJxs4nZtBAW+W2t9AY3wteqD2Dm9vEcZbUMIsDKj8t9BzGLn5pMSvlmy3KTpfo C4mZ5amtiqeUZtbfZp+atsyIyyiFJbSqtscf99GotQuMB79fwtyvQ2f4VzGUNTETI0tM 2orX5jbwBqxWX+HpeBkmcwp/9KPADyxerTGGXiDtRuqTwx7fUjnCperz6EpkOmZ/kUio b9fFUwgs8v47A1NJxaudr971SCzDoOaGI7qmGIQCluIofTYkXcIXt14xaWwtIVdjbT5P G36w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=gJwlEguC; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-115804-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-115804-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id q13-20020a635c0d000000b005dc957fe128si7007981pgb.74.2024.03.25.02.25.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Mar 2024 02:25:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-115804-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=gJwlEguC; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-115804-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-115804-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id EA86329D1D9 for ; Mon, 25 Mar 2024 09:25:23 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 79AED373FAA; Mon, 25 Mar 2024 03:01:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="gJwlEguC" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3E79B53381; Sun, 24 Mar 2024 23:13:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711321991; cv=none; b=qKCRjLchNdHqb++CbLy7bdetluMgLZwI91L/OfwFf4935yYT65gCnKA+7CsMn0RNVlFYVVNzvN83akl90VzDPQGvKFb5GWgBxXP/42CWbCwRgVs8Lxk/zyojci3pETnhUa2q0HJxUBq4Sc4DkXmxKrICTzfzNqc9cEX9jmzCQcA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711321991; c=relaxed/simple; bh=zQqdpurwLB2EgsGZIeSezaN1OoSb/wsrwDE1e5WoJXQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=NJYlsby7yZirpLopzY36eyyw7IfdCWIUnu4csl9JMM3LuHCc46H0xYSVIA3ixXGhsdOEXHKHnY0RiVjqzS0M5kjDGYbyGavVHvsduk8zYq5sj+ZWvEDgzS1tG8cklkoyiUZs0rmFiRUSRAORbLJL0PDnoSOBBlkrMCTnxWyBn7w= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=gJwlEguC; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 486D4C433F1; Sun, 24 Mar 2024 23:13:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711321990; bh=zQqdpurwLB2EgsGZIeSezaN1OoSb/wsrwDE1e5WoJXQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gJwlEguCPiWbo0NdVG6idd2rlJyQxrZCT5XuZSdK7yq4v4nyFkJpMuPJ/lbK7x0mQ BtMGDEpkjWVgmKCXMbpq1I86lgUu2JdeyHvGL5sceb6mxzeJbYXz/6Daa/AgbcqxxF x03ZiYNMWuwPn0l+dr4UwD/pHqsHgyidQXVr9/SMZ7AKsA38MSlmqo9icDs8HtdlnA Zof2269ZhY0zATQjsLVViIUSFq4SflfZYLHR9ArVRky/fFMh8aOm1DwkMKISrMLFKC /dpeQ2uOujkc2lEE+zffXCGL94J1JnxUt7CMCVOivS1bt7MDFsEE+LW5LulrNVxtv5 YE1DDLxz85Nfg== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Miroslav Franc , =?UTF-8?q?Jan=20H=C3=B6ppner?= , Stefan Haberland , Jens Axboe , Sasha Levin Subject: [PATCH 6.1 062/451] s390/dasd: fix double module refcount decrement Date: Sun, 24 Mar 2024 19:05:38 -0400 Message-ID: <20240324231207.1351418-63-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240324231207.1351418-1-sashal@kernel.org> References: <20240324231207.1351418-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit From: Miroslav Franc [ Upstream commit c3116e62ddeff79cae342147753ce596f01fcf06 ] Once the discipline is associated with the device, deleting the device takes care of decrementing the module's refcount. Doing it manually on this error path causes refcount to artificially decrease on each error while it should just stay the same. Fixes: c020d722b110 ("s390/dasd: fix panic during offline processing") Signed-off-by: Miroslav Franc Signed-off-by: Jan Höppner Signed-off-by: Stefan Haberland Link: https://lore.kernel.org/r/20240209124522.3697827-3-sth@linux.ibm.com Signed-off-by: Jens Axboe Signed-off-by: Sasha Levin --- drivers/s390/block/dasd.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/s390/block/dasd.c b/drivers/s390/block/dasd.c index 029bb9e15ad90..341d65acd715d 100644 --- a/drivers/s390/block/dasd.c +++ b/drivers/s390/block/dasd.c @@ -3512,12 +3512,11 @@ int dasd_generic_set_online(struct ccw_device *cdev, dasd_delete_device(device); return -EINVAL; } + device->base_discipline = base_discipline; if (!try_module_get(discipline->owner)) { - module_put(base_discipline->owner); dasd_delete_device(device); return -EINVAL; } - device->base_discipline = base_discipline; device->discipline = discipline; /* check_device will allocate block device if necessary */ @@ -3525,8 +3524,6 @@ int dasd_generic_set_online(struct ccw_device *cdev, if (rc) { dev_warn(dev, "Setting the DASD online with discipline %s failed with rc=%i\n", discipline->name, rc); - module_put(discipline->owner); - module_put(base_discipline->owner); dasd_delete_device(device); return rc; } -- 2.43.0