aboutsummaryrefslogtreecommitdiffstats
path: root/fs/notify
diff options
context:
space:
mode:
authorEric Paris <eparis@redhat.com>2009-12-22 23:16:33 -0500
committerEric Paris <eparis@redhat.com>2010-07-28 09:58:31 -0400
commitd7f0ce4e436b6109527c51b0efe0deff53d215f7 (patch)
treeb3c78a9c8b97ecf0dad28776dc38d47e88483731 /fs/notify
parent2dfc1cae4c42b93b831b2417540df2b895ab7108 (diff)
inotify: do not spam console without limit
inotify was supposed to have a dmesg printk ratelimitor which would cause inotify to only emit one message per boot. The static bool was never set so it kept firing messages. This patch correctly limits warnings in multiple places. Signed-off-by: Eric Paris <eparis@redhat.com>
Diffstat (limited to 'fs/notify')
-rw-r--r--fs/notify/inotify/inotify_user.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/fs/notify/inotify/inotify_user.c b/fs/notify/inotify/inotify_user.c
index ce21ebaee89e..f2b542479e91 100644
--- a/fs/notify/inotify/inotify_user.c
+++ b/fs/notify/inotify/inotify_user.c
@@ -449,20 +449,18 @@ static void inotify_remove_from_idr(struct fsnotify_group *group,
449 * if it wasn't.... 449 * if it wasn't....
450 */ 450 */
451 if (wd == -1) { 451 if (wd == -1) {
452 printk(KERN_WARNING "%s: ientry=%p ientry->wd=%d ientry->group=%p" 452 WARN_ONCE(1, "%s: ientry=%p ientry->wd=%d ientry->group=%p"
453 " ientry->inode=%p\n", __func__, ientry, ientry->wd, 453 " ientry->inode=%p\n", __func__, ientry, ientry->wd,
454 ientry->fsn_entry.group, ientry->fsn_entry.inode); 454 ientry->fsn_entry.group, ientry->fsn_entry.inode);
455 WARN_ON(1);
456 goto out; 455 goto out;
457 } 456 }
458 457
459 /* Lets look in the idr to see if we find it */ 458 /* Lets look in the idr to see if we find it */
460 found_ientry = inotify_idr_find_locked(group, wd); 459 found_ientry = inotify_idr_find_locked(group, wd);
461 if (unlikely(!found_ientry)) { 460 if (unlikely(!found_ientry)) {
462 printk(KERN_WARNING "%s: ientry=%p ientry->wd=%d ientry->group=%p" 461 WARN_ONCE(1, "%s: ientry=%p ientry->wd=%d ientry->group=%p"
463 " ientry->inode=%p\n", __func__, ientry, ientry->wd, 462 " ientry->inode=%p\n", __func__, ientry, ientry->wd,
464 ientry->fsn_entry.group, ientry->fsn_entry.inode); 463 ientry->fsn_entry.group, ientry->fsn_entry.inode);
465 WARN_ON(1);
466 goto out; 464 goto out;
467 } 465 }
468 466
@@ -472,8 +470,7 @@ static void inotify_remove_from_idr(struct fsnotify_group *group,
472 * fucked up somewhere. 470 * fucked up somewhere.
473 */ 471 */
474 if (unlikely(found_ientry != ientry)) { 472 if (unlikely(found_ientry != ientry)) {
475 WARN_ON(1); 473 WARN_ONCE(1, "%s: ientry=%p ientry->wd=%d ientry->group=%p "
476 printk(KERN_WARNING "%s: ientry=%p ientry->wd=%d ientry->group=%p "
477 "entry->inode=%p found_ientry=%p found_ientry->wd=%d " 474 "entry->inode=%p found_ientry=%p found_ientry->wd=%d "
478 "found_ientry->group=%p found_ientry->inode=%p\n", 475 "found_ientry->group=%p found_ientry->inode=%p\n",
479 __func__, ientry, ientry->wd, ientry->fsn_entry.group, 476 __func__, ientry, ientry->wd, ientry->fsn_entry.group,
@@ -489,7 +486,7 @@ static void inotify_remove_from_idr(struct fsnotify_group *group,
489 * one ref grabbed by inotify_idr_find 486 * one ref grabbed by inotify_idr_find
490 */ 487 */
491 if (unlikely(atomic_read(&ientry->fsn_entry.refcnt) < 3)) { 488 if (unlikely(atomic_read(&ientry->fsn_entry.refcnt) < 3)) {
492 printk(KERN_WARNING "%s: ientry=%p ientry->wd=%d ientry->group=%p" 489 printk(KERN_ERR "%s: ientry=%p ientry->wd=%d ientry->group=%p"
493 " ientry->inode=%p\n", __func__, ientry, ientry->wd, 490 " ientry->inode=%p\n", __func__, ientry, ientry->wd,
494 ientry->fsn_entry.group, ientry->fsn_entry.inode); 491 ientry->fsn_entry.group, ientry->fsn_entry.inode);
495 /* we can't really recover with bad ref cnting.. */ 492 /* we can't really recover with bad ref cnting.. */