dir.c (2ed886852adfcb070bf350e66a0da0d98b2f3ab5) dir.c (24676da469f50f433baa347845639662c561d1f6)
1/*
2 * linux/fs/ext4/dir.c
3 *
4 * Copyright (C) 1992, 1993, 1994, 1995
5 * Remy Card (card@masi.ibp.fr)
6 * Laboratoire MASI - Institut Blaise Pascal
7 * Universite Pierre et Marie Curie (Paris VI)
8 *

--- 69 unchanged lines hidden (view full) ---

78 error_msg = "rec_len is too small for name_len";
79 else if (((char *) de - bh->b_data) + rlen > dir->i_sb->s_blocksize)
80 error_msg = "directory entry across blocks";
81 else if (le32_to_cpu(de->inode) >
82 le32_to_cpu(EXT4_SB(dir->i_sb)->s_es->s_inodes_count))
83 error_msg = "inode out of bounds";
84
85 if (error_msg != NULL)
1/*
2 * linux/fs/ext4/dir.c
3 *
4 * Copyright (C) 1992, 1993, 1994, 1995
5 * Remy Card (card@masi.ibp.fr)
6 * Laboratoire MASI - Institut Blaise Pascal
7 * Universite Pierre et Marie Curie (Paris VI)
8 *

--- 69 unchanged lines hidden (view full) ---

78 error_msg = "rec_len is too small for name_len";
79 else if (((char *) de - bh->b_data) + rlen > dir->i_sb->s_blocksize)
80 error_msg = "directory entry across blocks";
81 else if (le32_to_cpu(de->inode) >
82 le32_to_cpu(EXT4_SB(dir->i_sb)->s_es->s_inodes_count))
83 error_msg = "inode out of bounds";
84
85 if (error_msg != NULL)
86 __ext4_error(dir->i_sb, function,
87 "bad entry in directory #%lu: %s - block=%llu"
86 ext4_error_inode(function, dir,
87 "bad entry in directory: %s - block=%llu"
88 "offset=%u(%u), inode=%u, rec_len=%d, name_len=%d",
88 "offset=%u(%u), inode=%u, rec_len=%d, name_len=%d",
89 dir->i_ino, error_msg,
90 (unsigned long long) bh->b_blocknr,
89 error_msg, (unsigned long long) bh->b_blocknr,
91 (unsigned) (offset%bh->b_size), offset,
92 le32_to_cpu(de->inode),
93 rlen, de->name_len);
94 return error_msg == NULL ? 1 : 0;
95}
96
97static int ext4_readdir(struct file *filp,
98 void *dirent, filldir_t filldir)

--- 48 unchanged lines hidden (view full) ---

147 }
148
149 /*
150 * We ignore I/O errors on directories so users have a chance
151 * of recovering data when there's a bad sector
152 */
153 if (!bh) {
154 if (!dir_has_error) {
90 (unsigned) (offset%bh->b_size), offset,
91 le32_to_cpu(de->inode),
92 rlen, de->name_len);
93 return error_msg == NULL ? 1 : 0;
94}
95
96static int ext4_readdir(struct file *filp,
97 void *dirent, filldir_t filldir)

--- 48 unchanged lines hidden (view full) ---

146 }
147
148 /*
149 * We ignore I/O errors on directories so users have a chance
150 * of recovering data when there's a bad sector
151 */
152 if (!bh) {
153 if (!dir_has_error) {
155 ext4_error(sb, "directory #%lu "
154 EXT4_ERROR_INODE(inode, "directory "
156 "contains a hole at offset %Lu",
155 "contains a hole at offset %Lu",
157 inode->i_ino,
158 (unsigned long long) filp->f_pos);
159 dir_has_error = 1;
160 }
161 /* corrupt size? Maybe no more blocks to read */
162 if (filp->f_pos > inode->i_blocks << 9)
163 break;
164 filp->f_pos += sb->s_blocksize - offset;
165 continue;

--- 362 unchanged lines hidden ---
156 (unsigned long long) filp->f_pos);
157 dir_has_error = 1;
158 }
159 /* corrupt size? Maybe no more blocks to read */
160 if (filp->f_pos > inode->i_blocks << 9)
161 break;
162 filp->f_pos += sb->s_blocksize - offset;
163 continue;

--- 362 unchanged lines hidden ---