mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: Minho Ban <mhban@samsung.com>
Cc: Len Brown <len.brown@intel.com>, Pavel Machek <pavel@ucw.cz>,
	Rob Landley <rob@landley.net>,
	linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org,
	linux-pm@vger.kernel.org
Subject: Re: [PATCH] PM / Hibernate : Use get_gendisk to verify partition if resume_file is integer format
Date: Mon, 14 May 2012 21:00:38 +0200	[thread overview]
Message-ID: <201205142100.38738.rjw@sisk.pl> (raw)
In-Reply-To: <4FB05770.3050809@samsung.com>

On Monday, May 14, 2012, Minho Ban wrote:
> On 05/13/2012 06:39 AM, Rafael J. Wysocki wrote:
> > On Wednesday, May 09, 2012, Minho Ban wrote:
> >>  	/* 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);
> >> +	}
> > 
> > Hmm.  Wouldn't it be better to do:
> > 
> > 	if (isdigit(resume_file[0]) && resume_wait) {
> > 		int partno;
> > 		while (!get_gendisk(swsusp_resume_device, &partno))
> > 			msleep(10);
> > 	} else {
> > 		swsusp_resume_device = name_to_dev_t(resume_file);
> > 	}
> > 
> > ?
> 
> Do you want name_to_dev_t to be called again?  If not, swsusp_resume_device parameter 
> in get_gendisk can not be used because it is not initialized yet.

Ah, OK, I didn't notice that.

I think I can take the patch for v3.5 as is.

Thanks,
Rafael

      reply	other threads:[~2012-05-14 18:55 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-09 10:23 Minho Ban
2012-05-12 21:39 ` Rafael J. Wysocki
2012-05-14  0:53   ` Minho Ban
2012-05-14 19:00     ` Rafael J. Wysocki [this message]

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=201205142100.38738.rjw@sisk.pl \
    --to=rjw@sisk.pl \
    --cc=len.brown@intel.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=mhban@samsung.com \
    --cc=pavel@ucw.cz \
    --cc=rob@landley.net \
    /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

all inboxes | Powered by JetHome®