LKML Archive on lore.kernel.org
 help / color / Atom feed
From: Minho Ban <mhban@samsung.com>
To: "Rafael J. Wysocki" <rjw@sisk.pl>
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 09:53:04 +0900
Message-ID: <4FB05770.3050809@samsung.com> (raw)
In-Reply-To: <201205122339.01696.rjw@sisk.pl>

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.

> 
> Your new code will overwrite whatever swsusp_resume_device is set to by the
> preceding statement anyway.
> 

Sorry, I don't understand what will be overwritten by the new code. It would be very 
much appreciated if you point it again.

Regards,
Minho Ban

  reply index

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 [this message]
2012-05-14 19:00     ` Rafael J. Wysocki

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

LKML Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/lkml/0 lkml/git/0.git
	git clone --mirror https://lore.kernel.org/lkml/1 lkml/git/1.git
	git clone --mirror https://lore.kernel.org/lkml/2 lkml/git/2.git
	git clone --mirror https://lore.kernel.org/lkml/3 lkml/git/3.git
	git clone --mirror https://lore.kernel.org/lkml/4 lkml/git/4.git
	git clone --mirror https://lore.kernel.org/lkml/5 lkml/git/5.git
	git clone --mirror https://lore.kernel.org/lkml/6 lkml/git/6.git
	git clone --mirror https://lore.kernel.org/lkml/7 lkml/git/7.git
	git clone --mirror https://lore.kernel.org/lkml/8 lkml/git/8.git
	git clone --mirror https://lore.kernel.org/lkml/9 lkml/git/9.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 lkml lkml/ https://lore.kernel.org/lkml \
		linux-kernel@vger.kernel.org
	public-inbox-index lkml

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-kernel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git