diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-08-07 16:03:53 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-08-07 16:03:53 -0400 |
commit | 09dc942c2a767e2d298f1cc9294bc19c7d7208c5 (patch) | |
tree | d310c118467c90c264e953bdc320ae08394c662a /fs/ext4/dir.c | |
parent | 90e0c225968f0878e090c7ff3f88323973476cee (diff) | |
parent | 6c7a120ac6c62316ab1fc78dfc0a7b13f3bfcbff (diff) |
Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4
* 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4: (40 commits)
ext4: Adding error check after calling ext4_mb_regular_allocator()
ext4: Fix dirtying of journalled buffers in data=journal mode
ext4: re-inline ext4_rec_len_(to|from)_disk functions
jbd2: Remove t_handle_lock from start_this_handle()
jbd2: Change j_state_lock to be a rwlock_t
jbd2: Use atomic variables to avoid taking t_handle_lock in jbd2_journal_stop
ext4: Add mount options in superblock
ext4: force block allocation on quota_off
ext4: fix freeze deadlock under IO
ext4: drop inode from orphan list if ext4_delete_inode() fails
ext4: check to make make sure bd_dev is set before dereferencing it
jbd2: Make barrier messages less scary
ext4: don't print scary messages for allocation failures post-abort
ext4: fix EFBIG edge case when writing to large non-extent file
ext4: fix ext4_get_blocks references
ext4: Always journal quota file modifications
ext4: Fix potential memory leak in ext4_fill_super
ext4: Don't error out the fs if the user tries to make a file too big
ext4: allocate stripe-multiple IOs on stripe boundaries
ext4: move aio completion after unwritten extent conversion
...
Fix up conflicts in fs/ext4/inode.c as per Ted.
Fix up xfs conflicts as per earlier xfs merge.
Diffstat (limited to 'fs/ext4/dir.c')
-rw-r--r-- | fs/ext4/dir.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/fs/ext4/dir.c b/fs/ext4/dir.c index ea5e6cb7e2a5..374510f72baa 100644 --- a/fs/ext4/dir.c +++ b/fs/ext4/dir.c | |||
@@ -61,10 +61,11 @@ static unsigned char get_dtype(struct super_block *sb, int filetype) | |||
61 | } | 61 | } |
62 | 62 | ||
63 | 63 | ||
64 | int ext4_check_dir_entry(const char *function, struct inode *dir, | 64 | int __ext4_check_dir_entry(const char *function, unsigned int line, |
65 | struct ext4_dir_entry_2 *de, | 65 | struct inode *dir, |
66 | struct buffer_head *bh, | 66 | struct ext4_dir_entry_2 *de, |
67 | unsigned int offset) | 67 | struct buffer_head *bh, |
68 | unsigned int offset) | ||
68 | { | 69 | { |
69 | const char *error_msg = NULL; | 70 | const char *error_msg = NULL; |
70 | const int rlen = ext4_rec_len_from_disk(de->rec_len, | 71 | const int rlen = ext4_rec_len_from_disk(de->rec_len, |
@@ -83,11 +84,10 @@ int ext4_check_dir_entry(const char *function, struct inode *dir, | |||
83 | error_msg = "inode out of bounds"; | 84 | error_msg = "inode out of bounds"; |
84 | 85 | ||
85 | if (error_msg != NULL) | 86 | if (error_msg != NULL) |
86 | ext4_error_inode(function, dir, | 87 | ext4_error_inode(dir, function, line, bh->b_blocknr, |
87 | "bad entry in directory: %s - block=%llu" | 88 | "bad entry in directory: %s - " |
88 | "offset=%u(%u), inode=%u, rec_len=%d, name_len=%d", | 89 | "offset=%u(%u), inode=%u, rec_len=%d, name_len=%d", |
89 | error_msg, (unsigned long long) bh->b_blocknr, | 90 | error_msg, (unsigned) (offset%bh->b_size), offset, |
90 | (unsigned) (offset%bh->b_size), offset, | ||
91 | le32_to_cpu(de->inode), | 91 | le32_to_cpu(de->inode), |
92 | rlen, de->name_len); | 92 | rlen, de->name_len); |
93 | return error_msg == NULL ? 1 : 0; | 93 | return error_msg == NULL ? 1 : 0; |
@@ -121,7 +121,8 @@ static int ext4_readdir(struct file *filp, | |||
121 | * We don't set the inode dirty flag since it's not | 121 | * We don't set the inode dirty flag since it's not |
122 | * critical that it get flushed back to the disk. | 122 | * critical that it get flushed back to the disk. |
123 | */ | 123 | */ |
124 | ext4_clear_inode_flag(filp->f_path.dentry->d_inode, EXT4_INODE_INDEX); | 124 | ext4_clear_inode_flag(filp->f_path.dentry->d_inode, |
125 | EXT4_INODE_INDEX); | ||
125 | } | 126 | } |
126 | stored = 0; | 127 | stored = 0; |
127 | offset = filp->f_pos & (sb->s_blocksize - 1); | 128 | offset = filp->f_pos & (sb->s_blocksize - 1); |
@@ -193,7 +194,7 @@ revalidate: | |||
193 | while (!error && filp->f_pos < inode->i_size | 194 | while (!error && filp->f_pos < inode->i_size |
194 | && offset < sb->s_blocksize) { | 195 | && offset < sb->s_blocksize) { |
195 | de = (struct ext4_dir_entry_2 *) (bh->b_data + offset); | 196 | de = (struct ext4_dir_entry_2 *) (bh->b_data + offset); |
196 | if (!ext4_check_dir_entry("ext4_readdir", inode, de, | 197 | if (!ext4_check_dir_entry(inode, de, |
197 | bh, offset)) { | 198 | bh, offset)) { |
198 | /* | 199 | /* |
199 | * On error, skip the f_pos to the next block | 200 | * On error, skip the f_pos to the next block |
@@ -343,7 +344,7 @@ int ext4_htree_store_dirent(struct file *dir_file, __u32 hash, | |||
343 | struct dir_private_info *info; | 344 | struct dir_private_info *info; |
344 | int len; | 345 | int len; |
345 | 346 | ||
346 | info = (struct dir_private_info *) dir_file->private_data; | 347 | info = dir_file->private_data; |
347 | p = &info->root.rb_node; | 348 | p = &info->root.rb_node; |
348 | 349 | ||
349 | /* Create and allocate the fname structure */ | 350 | /* Create and allocate the fname structure */ |