diff options
| author | Ingo Molnar <mingo@elte.hu> | 2009-03-03 00:08:56 +0300 |
|---|---|---|
| committer | Ingo Molnar <mingo@elte.hu> | 2009-03-03 00:08:56 +0300 |
| commit | c02368a9d059322f913a58111eade87a656fefd5 (patch) | |
| tree | 2f02dbbe69b86535f58d2010d9adfb20a9c16fb9 /fs/ext4/ext4.h | |
| parent | f17c75453b2d195eba0a90d9f16a3ba88c85b3b4 (diff) | |
| parent | 778ef1e6cbb049c9bcbf405936ee6f2b6e451892 (diff) | |
| download | linux-c02368a9d059322f913a58111eade87a656fefd5.tar.xz | |
Merge branch 'linus' into irq/genirq
Diffstat (limited to 'fs/ext4/ext4.h')
| -rw-r--r-- | fs/ext4/ext4.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h index c668e4377d76..b0c87dce66a3 100644 --- a/fs/ext4/ext4.h +++ b/fs/ext4/ext4.h @@ -868,7 +868,7 @@ static inline unsigned ext4_rec_len_from_disk(__le16 dlen) { unsigned len = le16_to_cpu(dlen); - if (len == EXT4_MAX_REC_LEN) + if (len == EXT4_MAX_REC_LEN || len == 0) return 1 << 16; return len; } @@ -1206,8 +1206,11 @@ static inline void ext4_r_blocks_count_set(struct ext4_super_block *es, static inline loff_t ext4_isize(struct ext4_inode *raw_inode) { - return ((loff_t)le32_to_cpu(raw_inode->i_size_high) << 32) | - le32_to_cpu(raw_inode->i_size_lo); + if (S_ISREG(le16_to_cpu(raw_inode->i_mode))) + return ((loff_t)le32_to_cpu(raw_inode->i_size_high) << 32) | + le32_to_cpu(raw_inode->i_size_lo); + else + return (loff_t) le32_to_cpu(raw_inode->i_size_lo); } static inline void ext4_isize_set(struct ext4_inode *raw_inode, loff_t i_size) |
