]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/ext4/dir.c
ext4: Avoid printk floods in the face of directory corruption
[linux-2.6-omap-h63xx.git] / fs / ext4 / dir.c
index d40da316921dfb33366ede2829b84e3dcf333097..3ca6a2b7632dcd987db185d3fbe40926628b3d78 100644 (file)
@@ -102,6 +102,7 @@ static int ext4_readdir(struct file *filp,
        int err;
        struct inode *inode = filp->f_path.dentry->d_inode;
        int ret = 0;
+       int dir_has_error = 0;
 
        sb = inode->i_sb;
 
@@ -148,9 +149,13 @@ static int ext4_readdir(struct file *filp,
                 * of recovering data when there's a bad sector
                 */
                if (!bh) {
-                       ext4_error(sb, "ext4_readdir",
-                               "directory #%lu contains a hole at offset %lu",
-                               inode->i_ino, (unsigned long)filp->f_pos);
+                       if (!dir_has_error) {
+                               ext4_error(sb, __func__, "directory #%lu "
+                                          "contains a hole at offset %Lu",
+                                          inode->i_ino,
+                                          (unsigned long long) filp->f_pos);
+                               dir_has_error = 1;
+                       }
                        /* corrupt size?  Maybe no more blocks to read */
                        if (filp->f_pos > inode->i_blocks << 9)
                                break;