浏览代码

ext4: Print the find_group_flex() warning only once

This is a short-term warning, and even printk_ratelimit() can result
in too much noise in system logs.  So only print it once as a warning.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o 16 年之前
父节点
当前提交
2842c3b544
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      fs/ext4/ialloc.c

+ 3 - 1
fs/ext4/ialloc.c

@@ -698,6 +698,7 @@ struct inode *ext4_new_inode(handle_t *handle, struct inode *dir, int mode)
 	struct inode *ret;
 	struct inode *ret;
 	ext4_group_t i;
 	ext4_group_t i;
 	int free = 0;
 	int free = 0;
+	static int once = 1;
 	ext4_group_t flex_group;
 	ext4_group_t flex_group;
 
 
 	/* Cannot create files in a deleted directory */
 	/* Cannot create files in a deleted directory */
@@ -719,7 +720,8 @@ struct inode *ext4_new_inode(handle_t *handle, struct inode *dir, int mode)
 		ret2 = find_group_flex(sb, dir, &group);
 		ret2 = find_group_flex(sb, dir, &group);
 		if (ret2 == -1) {
 		if (ret2 == -1) {
 			ret2 = find_group_other(sb, dir, &group);
 			ret2 = find_group_other(sb, dir, &group);
-			if (ret2 == 0 && printk_ratelimit())
+			if (ret2 == 0 && once)
+				once = 0;
 				printk(KERN_NOTICE "ext4: find_group_flex "
 				printk(KERN_NOTICE "ext4: find_group_flex "
 				       "failed, fallback succeeded dir %lu\n",
 				       "failed, fallback succeeded dir %lu\n",
 				       dir->i_ino);
 				       dir->i_ino);