All of lore.kernel.org
 help / color / mirror / Atom feed
* Nasty log spamming problem in ide proc changes
       [not found] <200411012006.iA1K6HR7010518@hera.kernel.org>
@ 2004-11-11 14:55 ` Alan Cox
  2004-11-11 16:10   ` Jens Axboe
  0 siblings, 1 reply; 3+ messages in thread
From: Alan Cox @ 2004-11-11 14:55 UTC (permalink / raw)
  To: Linux Kernel Mailing List; +Cc: Bartlomiej Zolnierkiewicz, torvalds

On Llu, 2004-11-01 at 17:18, Linux Kernel Mailing List wrote:
> ChangeSet 1.2424.1.2, 2004/11/01 18:18:35+01:00, bzolnier@trik.(none)
> 
> 	[ide] obsolete /proc/ide/hd?/settings
> 	
> 	Majority of these settings is also available through ioctls.
> 	We will deal with the rest during deprecation period.

Unfortunately while these changes are definitely a good thing.

>  
> +	printk(KERN_WARNING "Warning: /proc/ide/hd?/settings interface is "
> +			    "obsolete, and will be removed soon!\n");
> +

The above should be rate limited or on the write case moved to after
the capable() check. A program polling these settings now makes a nasty
noise and wipes the logs. A user can also do it intentionally.



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Nasty log spamming problem in ide proc changes
  2004-11-11 14:55 ` Nasty log spamming problem in ide proc changes Alan Cox
@ 2004-11-11 16:10   ` Jens Axboe
  2004-11-17 22:54     ` Bartlomiej Zolnierkiewicz
  0 siblings, 1 reply; 3+ messages in thread
From: Jens Axboe @ 2004-11-11 16:10 UTC (permalink / raw)
  To: Alan Cox; +Cc: Linux Kernel Mailing List, Bartlomiej Zolnierkiewicz, torvalds

On Thu, Nov 11 2004, Alan Cox wrote:
> > +	printk(KERN_WARNING "Warning: /proc/ide/hd?/settings interface is "
> > +			    "obsolete, and will be removed soon!\n");
> > +
> 
> The above should be rate limited or on the write case moved to after
> the capable() check. A program polling these settings now makes a nasty
> noise and wipes the logs. A user can also do it intentionally.

Or just print it once...

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Nasty log spamming problem in ide proc changes
  2004-11-11 16:10   ` Jens Axboe
@ 2004-11-17 22:54     ` Bartlomiej Zolnierkiewicz
  0 siblings, 0 replies; 3+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2004-11-17 22:54 UTC (permalink / raw)
  To: Jens Axboe; +Cc: Alan Cox, Linux Kernel Mailing List, torvalds

On Thu, 11 Nov 2004 17:10:21 +0100, Jens Axboe <axboe@suse.de> wrote:
> On Thu, Nov 11 2004, Alan Cox wrote:
> > > +   printk(KERN_WARNING "Warning: /proc/ide/hd?/settings interface is "
> > > +                       "obsolete, and will be removed soon!\n");
> > > +
> >
> > The above should be rate limited or on the write case moved to after
> > the capable() check. A program polling these settings now makes a nasty
> > noise and wipes the logs. A user can also do it intentionally.
> 
> Or just print it once...

I'm about to add this to ide-2.6...

[ide] fix /proc/ide/hd?/settings to not spam logs

On Thu, 11 Nov 2004 17:10:21 +0100, Jens Axboe <axboe@suse.de> wrote:
> On Thu, Nov 11 2004, Alan Cox wrote:
> > > +   printk(KERN_WARNING "Warning: /proc/ide/hd?/settings interface is "
> > > +                       "obsolete, and will be removed soon!\n");
> > > +
> >
> > The above should be rate limited or on the write case moved to after
> > the capable() check. A program polling these settings now makes a nasty
> > noise and wipes the logs. A user can also do it intentionally.
> 
> Or just print it once...

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>

diff -Nru a/drivers/ide/ide-proc.c b/drivers/ide/ide-proc.c
--- a/drivers/ide/ide-proc.c	2004-11-17 23:56:13 +01:00
+++ b/drivers/ide/ide-proc.c	2004-11-17 23:56:13 +01:00
@@ -124,6 +124,18 @@
 	PROC_IDE_READ_RETURN(page,start,off,count,eof,len);
 }
 
+static void proc_ide_settings_warn(void)
+{
+	static int warned = 0;
+
+	if (warned)
+		return;
+
+	printk(KERN_WARNING "Warning: /proc/ide/hd?/settings interface is "
+			    "obsolete, and will be removed soon!\n");
+	warned = 1;
+}
+
 static int proc_ide_read_settings
 	(char *page, char **start, off_t off, int count, int *eof, void *data)
 {
@@ -132,8 +144,7 @@
 	char		*out = page;
 	int		len, rc, mul_factor, div_factor;
 
-	printk(KERN_WARNING "Warning: /proc/ide/hd?/settings interface is "
-			    "obsolete, and will be removed soon!\n");
+	proc_ide_settings_warn();
 
 	down(&ide_setting_sem);
 	out += sprintf(out, "name\t\t\tvalue\t\tmin\t\tmax\t\tmode\n");
@@ -171,11 +182,10 @@
 	ide_settings_t	*setting;
 	char *buf, *s;
 
-	printk(KERN_WARNING "Warning: /proc/ide/hd?/settings interface is "
-			    "obsolete, and will be removed soon!\n");
-
 	if (!capable(CAP_SYS_ADMIN))
 		return -EACCES;
+
+	proc_ide_settings_warn();
 
 	if (count >= PAGE_SIZE)
 		return -EINVAL;

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-11-17 22:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <200411012006.iA1K6HR7010518@hera.kernel.org>
2004-11-11 14:55 ` Nasty log spamming problem in ide proc changes Alan Cox
2004-11-11 16:10   ` Jens Axboe
2004-11-17 22:54     ` Bartlomiej Zolnierkiewicz

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.