Skip to content

Commit 1ebf217

Browse files
harshadjstytso
authored andcommitted
ext4: inline data inode fast commit replay fixes
Since there are no blocks in an inline data inode, there's no point in fixing iblocks field in fast commit replay path for this inode. Similarly, there's no point in fixing any block bitmaps / global block counters with respect to such an inode. Just bail out from these functions if an inline data inode is encountered. Signed-off-by: Harshad Shirwadkar <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Theodore Ts'o <[email protected]>
1 parent 6c31a68 commit 1ebf217

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

fs/ext4/extents.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6071,6 +6071,9 @@ int ext4_ext_clear_bb(struct inode *inode)
60716071
int j, ret = 0;
60726072
struct ext4_map_blocks map;
60736073

6074+
if (ext4_test_inode_flag(inode, EXT4_INODE_INLINE_DATA))
6075+
return 0;
6076+
60746077
/* Determin the size of the file first */
60756078
path = ext4_find_extent(inode, EXT_MAX_BLOCKS - 1, NULL,
60766079
EXT4_EX_NOCACHE);

fs/ext4/fast_commit.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1526,7 +1526,8 @@ static int ext4_fc_replay_inode(struct super_block *sb, struct ext4_fc_tl *tl,
15261526
* crashing. This should be fixed but until then, we calculate
15271527
* the number of blocks the inode.
15281528
*/
1529-
ext4_ext_replay_set_iblocks(inode);
1529+
if (!ext4_test_inode_flag(inode, EXT4_INODE_INLINE_DATA))
1530+
ext4_ext_replay_set_iblocks(inode);
15301531

15311532
inode->i_generation = le32_to_cpu(ext4_raw_inode(&iloc)->i_generation);
15321533
ext4_reset_inode_seed(inode);
@@ -1844,6 +1845,10 @@ static void ext4_fc_set_bitmaps_and_counters(struct super_block *sb)
18441845
}
18451846
cur = 0;
18461847
end = EXT_MAX_BLOCKS;
1848+
if (ext4_test_inode_flag(inode, EXT4_INODE_INLINE_DATA)) {
1849+
iput(inode);
1850+
continue;
1851+
}
18471852
while (cur < end) {
18481853
map.m_lblk = cur;
18491854
map.m_len = end - cur;

0 commit comments

Comments
 (0)