diff options
Diffstat (limited to 'fs/ext4/dir.c')
-rw-r--r-- | fs/ext4/dir.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/fs/ext4/dir.c b/fs/ext4/dir.c index 2df2e40b01af..b64789929a65 100644 --- a/fs/ext4/dir.c +++ b/fs/ext4/dir.c | |||
@@ -67,7 +67,8 @@ int ext4_check_dir_entry(const char *function, struct inode *dir, | |||
67 | unsigned int offset) | 67 | unsigned int offset) |
68 | { | 68 | { |
69 | const char *error_msg = NULL; | 69 | const char *error_msg = NULL; |
70 | const int rlen = ext4_rec_len_from_disk(de->rec_len); | 70 | const int rlen = ext4_rec_len_from_disk(de->rec_len, |
71 | dir->i_sb->s_blocksize); | ||
71 | 72 | ||
72 | if (rlen < EXT4_DIR_REC_LEN(1)) | 73 | if (rlen < EXT4_DIR_REC_LEN(1)) |
73 | error_msg = "rec_len is smaller than minimal"; | 74 | error_msg = "rec_len is smaller than minimal"; |
@@ -178,10 +179,11 @@ revalidate: | |||
178 | * least that it is non-zero. A | 179 | * least that it is non-zero. A |
179 | * failure will be detected in the | 180 | * failure will be detected in the |
180 | * dirent test below. */ | 181 | * dirent test below. */ |
181 | if (ext4_rec_len_from_disk(de->rec_len) | 182 | if (ext4_rec_len_from_disk(de->rec_len, |
182 | < EXT4_DIR_REC_LEN(1)) | 183 | sb->s_blocksize) < EXT4_DIR_REC_LEN(1)) |
183 | break; | 184 | break; |
184 | i += ext4_rec_len_from_disk(de->rec_len); | 185 | i += ext4_rec_len_from_disk(de->rec_len, |
186 | sb->s_blocksize); | ||
185 | } | 187 | } |
186 | offset = i; | 188 | offset = i; |
187 | filp->f_pos = (filp->f_pos & ~(sb->s_blocksize - 1)) | 189 | filp->f_pos = (filp->f_pos & ~(sb->s_blocksize - 1)) |
@@ -203,7 +205,8 @@ revalidate: | |||
203 | ret = stored; | 205 | ret = stored; |
204 | goto out; | 206 | goto out; |
205 | } | 207 | } |
206 | offset += ext4_rec_len_from_disk(de->rec_len); | 208 | offset += ext4_rec_len_from_disk(de->rec_len, |
209 | sb->s_blocksize); | ||
207 | if (le32_to_cpu(de->inode)) { | 210 | if (le32_to_cpu(de->inode)) { |
208 | /* We might block in the next section | 211 | /* We might block in the next section |
209 | * if the data destination is | 212 | * if the data destination is |
@@ -225,7 +228,8 @@ revalidate: | |||
225 | goto revalidate; | 228 | goto revalidate; |
226 | stored++; | 229 | stored++; |
227 | } | 230 | } |
228 | filp->f_pos += ext4_rec_len_from_disk(de->rec_len); | 231 | filp->f_pos += ext4_rec_len_from_disk(de->rec_len, |
232 | sb->s_blocksize); | ||
229 | } | 233 | } |
230 | offset = 0; | 234 | offset = 0; |
231 | brelse(bh); | 235 | brelse(bh); |