Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp459982pxx; Wed, 28 Oct 2020 08:50:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxzzJHEzVitQMN2C23e3nMPzluipY4uzIZ/BEniFQXNd6r54ORWNpHMM5qMRInx52vvrCxl X-Received: by 2002:a17:906:2a09:: with SMTP id j9mr7950639eje.355.1603900249366; Wed, 28 Oct 2020 08:50:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603900249; cv=none; d=google.com; s=arc-20160816; b=FNpr47pfLwwAiMTDiEmhX8lKi5Baj2jk6hDvZxBl8soaBbmPO0cy1MTcCMcjfssAWh DxPiLqcpSKxbIPrvlh+G/ZYR+WVdUKpu/Zh5G6a6/gLkDuAXP6AcsQgl7n1GKtEY95w9 q4VzZIGtvW1q8Vg2iPdXKyhCAy84CkPQLkuNPm9CSCeHPyFhkEEzUambeOTJot0Co2T7 8mc476SD1Oqv5zMiN+zpgy/efdy9vZFRRLlMqTiofaoPkScZ6o8xVbUqi/zS5r4fjsih WvbA9xBQyTZkWx4u0N0npfatkZoKgcQb/3lEsJy56Iaxzo2vhR2Mp9fwscbXEU/XBGNo Uv/Q== 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=ncoUPNTR9QVG+fUC8mCziOWbC0NCG7cH8NSGb1noqK4=; b=USK+s04MlQ4S+HWPcjBaPmg1YJEWi06kn2PkL4J36emJxbL+fWjSuSw48bv1SY8Cq9 DIl598YiuIa/E7FlCcyp2uTRxmweSZAcKUOnQw6NxAV6mp+1ka6IE3OCT52kAJxjXkxh wbeLLh02tpXWYWwVZerIxXV466FVV7jMtZQTMSbYMld6AbrlGPs75ccWQ9iu1li7fyFJ FEEuxCfaLWHu+h2lDUSq9YmR4md6a24IYHRWvnxmgdYZ3ihTgLKBQ9fUTgcWWlah6ixQ hq6z9txv8XW0qXhpQxBqWv6DjV4hNGgaDuW8wpOQ9cHTsJfMgg6XO/cus84BsGpCa6EZ AoNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=UoEMNgx1; 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=fail (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 t1si2868715ejb.712.2020.10.28.08.50.27; Wed, 28 Oct 2020 08:50:49 -0700 (PDT) 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=@kernel.org header.s=default header.b=UoEMNgx1; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1813238AbgJ0Qto (ORCPT + 99 others); Tue, 27 Oct 2020 12:49:44 -0400 Received: from mail.kernel.org ([198.145.29.99]:50844 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1794840AbgJ0PNx (ORCPT ); Tue, 27 Oct 2020 11:13:53 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (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 BAE7020657; Tue, 27 Oct 2020 15:13:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603811633; bh=EsmeZiwtz1CEd+9P9WiTqdjUZJhkzUS4Hese3uC56H0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UoEMNgx1y3gDqo4XKAb9PE6RDidQdjXVDV2Qy5QMbzpIgflxQTSKnIB02rktY96rD 2Xeh549pvALNOq7T/agDnWKeM4JM/07nmcw17JC0TBZES9fDCKyrICFzOqdgNxXE0Z MWHatXUELuW4bDcWMuprxQmZQgcRL2BlVyqhczzg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Christoph Hellwig , "Rafael J. Wysocki" , Sasha Levin Subject: [PATCH 5.8 563/633] PM: hibernate: remove the bogus call to get_gendisk() in software_resume() Date: Tue, 27 Oct 2020 14:55:06 +0100 Message-Id: <20201027135549.219192192@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027135522.655719020@linuxfoundation.org> References: <20201027135522.655719020@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: Christoph Hellwig [ Upstream commit 428805c0c5e76ef643b1fbc893edfb636b3d8aef ] get_gendisk grabs a reference on the disk and file operation, so this code will leak both of them while having absolutely no use for the gendisk itself. This effectively reverts commit 2df83fa4bce421f ("PM / Hibernate: Use get_gendisk to verify partition if resume_file is integer format") Signed-off-by: Christoph Hellwig Signed-off-by: Rafael J. Wysocki Signed-off-by: Sasha Levin --- kernel/power/hibernate.c | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c index 02ec716a49271..0e60e10ed66a3 100644 --- a/kernel/power/hibernate.c +++ b/kernel/power/hibernate.c @@ -851,17 +851,6 @@ static int software_resume(void) /* Check if the device is there */ swsusp_resume_device = name_to_dev_t(resume_file); - - /* - * name_to_dev_t is ineffective to verify parition if resume_file is in - * integer format. (e.g. major:minor) - */ - if (isdigit(resume_file[0]) && resume_wait) { - int partno; - while (!get_gendisk(swsusp_resume_device, &partno)) - msleep(10); - } - if (!swsusp_resume_device) { /* * Some device discovery might still be in progress; we need -- 2.25.1