From patchwork Tue Oct 27 13:50:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 311799 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9075CC388F9 for ; Tue, 27 Oct 2020 18:11:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 305EB20790 for ; Tue, 27 Oct 2020 18:11:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603822291; bh=4eFD7TwZnawJg4Hi1+00/SCKX7MXlqWJUocga77l13Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=FwL0qiE752T0o4lZnJxXuL30qyY3c9lbJ4SSDM/PQHzeaPRbNgOX4V3A/m6H3klL1 fzkPpxWfwAErx4Ui+jRwcTSK+8Z+diZXSzNd6DjYJeBdF8RZGeedirDAHGDKxJv+fg O4eEHz0VDzAJn4j4USrk9yimb5lm75H+js82Ls2A= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756089AbgJ0OPC (ORCPT ); Tue, 27 Oct 2020 10:15:02 -0400 Received: from mail.kernel.org ([198.145.29.99]:36734 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755536AbgJ0OPA (ORCPT ); Tue, 27 Oct 2020 10:15:00 -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 21FDB206F7; Tue, 27 Oct 2020 14:14:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603808099; bh=4eFD7TwZnawJg4Hi1+00/SCKX7MXlqWJUocga77l13Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZcrPOdiyNnZnrq2qxlTzB7rTqYqfF0FA4V/cfgTjT4ENSPnoMN+yn0bw4XsU9vWtq WJqtkI/xyRKXuENT008EApBAHMY/3rgi4VqMTboYOQwe7pv/TyKc/j3LuPX7a+YVof Gu5npiSnRSm1Fjjdx4y7GEpYMCyy/UCTNLiHHYhA= 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 4.14 156/191] PM: hibernate: remove the bogus call to get_gendisk() in software_resume() Date: Tue, 27 Oct 2020 14:50:11 +0100 Message-Id: <20201027134917.214050842@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027134909.701581493@linuxfoundation.org> References: <20201027134909.701581493@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@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 2e65aacfa1162..02df69a8ee3c0 100644 --- a/kernel/power/hibernate.c +++ b/kernel/power/hibernate.c @@ -833,17 +833,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