Message ID | 200906230951.24615.elendil@planet.nl |
---|---|
State | Accepted |
Delegated to: | David Miller |
Headers | show |
On Tue, Jun 23, 2009 at 09:51:23AM +0200, Frans Pop wrote: [..] > --- > From: Frans Pop <elendil@planet.nl> > Subject: ide-cd: Improve "weird block size" error message > > Currently the error gets repeated too frequently, for example > each time HAL polls the device when a disc is present. Avoid that > by using printk_once instead of printk. > Also join the error and corrective action messages into a single line. > > Signed-off-by: Frans Pop <elendil@planet.nl> > Cc: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> > > diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c > index 4a19686..7ec6996 100644 > --- a/drivers/ide/ide-cd.c > +++ b/drivers/ide/ide-cd.c > @@ -886,10 +886,9 @@ static int cdrom_read_capacity(ide_drive_t *drive, unsigned long *capacity, > case 4096: > break; > default: > - printk(KERN_ERR PFX "%s: weird block size %u\n", > + printk_once(KERN_ERR PFX "%s: weird block size %u; " > + "setting default block size to 2048\n", > drive->name, blocklen); > - printk(KERN_ERR PFX "%s: default to 2kb block size\n", > - drive->name); Please leave the weird block size in the printk since it sometimes might give insights on what is going on. Thanks.
On Tue, Jun 23, 2009 at 09:57:33AM +0200, Borislav Petkov wrote: > On Tue, Jun 23, 2009 at 09:51:23AM +0200, Frans Pop wrote: > > [..] > > > --- > > From: Frans Pop <elendil@planet.nl> > > Subject: ide-cd: Improve "weird block size" error message > > > > Currently the error gets repeated too frequently, for example > > each time HAL polls the device when a disc is present. Avoid that > > by using printk_once instead of printk. > > Also join the error and corrective action messages into a single line. > > > > Signed-off-by: Frans Pop <elendil@planet.nl> > > Cc: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> > > > > diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c > > index 4a19686..7ec6996 100644 > > --- a/drivers/ide/ide-cd.c > > +++ b/drivers/ide/ide-cd.c > > @@ -886,10 +886,9 @@ static int cdrom_read_capacity(ide_drive_t *drive, unsigned long *capacity, > > case 4096: > > break; > > default: > > - printk(KERN_ERR PFX "%s: weird block size %u\n", > > + printk_once(KERN_ERR PFX "%s: weird block size %u; " > > + "setting default block size to 2048\n", > > drive->name, blocklen); > > - printk(KERN_ERR PFX "%s: default to 2kb block size\n", > > - drive->name); > Ah, nevermind! Hadn't had a coffee yet, sorry :). Acked-by: Borislav Petkov <petkovbb@gmail.com>
On Tuesday 23 June 2009, Borislav Petkov wrote: > > diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c > > index 4a19686..7ec6996 100644 > > --- a/drivers/ide/ide-cd.c > > +++ b/drivers/ide/ide-cd.c > > @@ -886,10 +886,9 @@ static int cdrom_read_capacity(ide_drive_t > > *drive, unsigned long *capacity, case 4096: > > break; > > default: > > - printk(KERN_ERR PFX "%s: weird block size %u\n", > > + printk_once(KERN_ERR PFX "%s: weird block size %u; " ^^^^^^^ > > + "setting default block size to 2048\n", > > drive->name, blocklen); > > - printk(KERN_ERR PFX "%s: default to 2kb block size\n", > > - drive->name); > > Please leave the weird block size in the printk since it sometimes > might give insights on what is going on. I did :-) -- To unsubscribe from this list: send the line "unsubscribe linux-ide" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
From: Borislav Petkov <petkovbb@googlemail.com> Date: Tue, 23 Jun 2009 10:02:23 +0200 > On Tue, Jun 23, 2009 at 09:57:33AM +0200, Borislav Petkov wrote: >> On Tue, Jun 23, 2009 at 09:51:23AM +0200, Frans Pop wrote: >> >> [..] >> >> > --- >> > From: Frans Pop <elendil@planet.nl> >> > Subject: ide-cd: Improve "weird block size" error message >> > >> > Currently the error gets repeated too frequently, for example >> > each time HAL polls the device when a disc is present. Avoid that >> > by using printk_once instead of printk. >> > Also join the error and corrective action messages into a single line. >> > >> > Signed-off-by: Frans Pop <elendil@planet.nl> >> > Cc: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> ... > Acked-by: Borislav Petkov <petkovbb@gmail.com> Applied, thanks! -- To unsubscribe from this list: send the line "unsubscribe linux-ide" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c index 4a19686..7ec6996 100644 --- a/drivers/ide/ide-cd.c +++ b/drivers/ide/ide-cd.c @@ -886,10 +886,9 @@ static int cdrom_read_capacity(ide_drive_t *drive, unsigned long *capacity, case 4096: break; default: - printk(KERN_ERR PFX "%s: weird block size %u\n", + printk_once(KERN_ERR PFX "%s: weird block size %u; " + "setting default block size to 2048\n", drive->name, blocklen); - printk(KERN_ERR PFX "%s: default to 2kb block size\n", - drive->name); blocklen = 2048; break; }