Re: [PATCH] PM / Hibernate : Use get_gendisk to verify partition if resume_file is integer format

From: Rafael J. Wysocki
Date: Mon May 14 2012 - 14:55:40 EST


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