public inbox for linux-block@vger.kernel.org
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@ucw.cz>
To: Christoph Hellwig <hch@lst.de>
Cc: Tejun Heo <tj@kernel.org>, Jens Axboe <axboe@kernel.dk>,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Len Brown <len.brown@intel.com>, Minho Ban <mhban@samsung.com>,
	cgroups@vger.kernel.org, linux-block@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org
Subject: Re: [PATCH 2/2] PM/hibernate: remove the bogus call to get_gendisk in software_resume
Date: Fri, 25 Sep 2020 20:38:28 +0200	[thread overview]
Message-ID: <20200925183828.GC7253@duo.ucw.cz> (raw)
In-Reply-To: <20200925161447.1486883-3-hch@lst.de>

[-- Attachment #1: Type: text/plain, Size: 1417 bytes --]

Hi!

> 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 <hch@lst.de>
> ---
>  kernel/power/hibernate.c | 11 -----------
>  1 file changed, 11 deletions(-)
> 
> diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c
> index e7aa57fb2fdc33..7d0b99d2e69631 100644
> --- a/kernel/power/hibernate.c
> +++ b/kernel/power/hibernate.c
> @@ -948,17 +948,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);
> -	}

I believe point of this code was to wait for resume device to appear
-- see the resume_wait condition. It should not be simply removed.

Best regards,
								Pavel
-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

  reply	other threads:[~2020-09-25 18:38 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-25 16:14 RFC: sort out get_gendisk abuses Christoph Hellwig
2020-09-25 16:14 ` [PATCH 1/2] blk-cgroup: stop abusing get_gendisk Christoph Hellwig
2020-09-25 16:14 ` [PATCH 2/2] PM/hibernate: remove the bogus call to get_gendisk in software_resume Christoph Hellwig
2020-09-25 18:38   ` Pavel Machek [this message]
2020-09-26 14:05     ` Christoph Hellwig
2020-09-30 15:45   ` Rafael J. Wysocki
2020-10-02  6:50     ` Christoph Hellwig
2020-10-02 14:11       ` Rafael J. Wysocki
2020-09-30 16:17 ` RFC: sort out get_gendisk abuses Tejun Heo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200925183828.GC7253@duo.ucw.cz \
    --to=pavel@ucw.cz \
    --cc=axboe@kernel.dk \
    --cc=cgroups@vger.kernel.org \
    --cc=hch@lst.de \
    --cc=len.brown@intel.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=mhban@samsung.com \
    --cc=rjw@rjwysocki.net \
    --cc=tj@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox