lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 14 May 2012 09:53:04 +0900
From:	Minho Ban <mhban@...sung.com>
To:	"Rafael J. Wysocki" <rjw@...k.pl>
Cc:	Len Brown <len.brown@...el.com>, Pavel Machek <pavel@....cz>,
	Rob Landley <rob@...dley.net>, linux-kernel@...r.kernel.org,
	linux-doc@...r.kernel.org, linux-pm@...r.kernel.org
Subject: Re: [PATCH] PM / Hibernate : Use get_gendisk to verify partition if
 resume_file is integer format

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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists