[PATCH][BUG][RFC] ext4: Each meaning of the offset in ext4_check_dir_entry calling from some functions should be unified.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Toshiyuki Okajima <toshi.okajima@xxxxxxxxxxxxxx>

This problem is originated from the one message which has two meanings.
Meanings are: 
- File offset
  used by:
   ext4_readdir, htree_dirblock_to_tree, search_dirblock, ext4_dx_find_entry,
   empty_dir
- Buffer offset
  used by:
   add_dirent_to_buf, ext4_delete_entry

To solve this, there is the method how we change the meaning of add_dirent_to_buf() and 
ext4_delete_entry() but it is not easy to change. But we can solve this problem easily
if we unify the meanings into "Buffer offset". So, instead of "File Offset" meaning,
we add the block number information to this message.

--- Examples ---
Original:
EXT4-fs error (device loop0): htree_dirblock_to_tree: bad entry in directory \
#12: rec_len is too small for name_len - offset=12288, inode=216, rec_len=12,\
 name_len=11

Change:
EXT4-fs error (device loop0): htree_dirblock_to_tree: bad entry in directory \
#12: rec_len is too small for name_len - block_nr=78:offset=0, inode=216, \
rec_len=12, name_len=11

Signed-off-by: Toshiyuki Okajima <toshi.okajima@xxxxxxxxxxxxxx>
--
 fs/ext4/dir.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff -Nurp linux-2.6.32-rc7.org/fs/ext4/dir.c linux-2.6.32-rc7/fs/ext4/dir.c
--- linux-2.6.32-rc7.org/fs/ext4/dir.c	2009-11-13 09:46:07.000000000 +0900
+++ linux-2.6.32-rc7/fs/ext4/dir.c	2009-11-19 18:32:31.000000000 +0900
@@ -84,9 +84,10 @@ int ext4_check_dir_entry(const char *fun
 
 	if (error_msg != NULL)
 		ext4_error(dir->i_sb, function,
-			"bad entry in directory #%lu: %s - "
+			"bad entry in directory #%lu: %s - block_nr=%llu:"
 			"offset=%u, inode=%u, rec_len=%d, name_len=%d",
-			dir->i_ino, error_msg, offset,
+			dir->i_ino, error_msg, 
+			(u64)bh->b_blocknr, (u32)(offset%bh->b_size),
 			le32_to_cpu(de->inode),
 			rlen, de->name_len);
 	return error_msg == NULL ? 1 : 0;
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux