Skip to contentSkip to conversation

ext4: no need to verify new add extent block

PATCH Applied yangerkun 3 participants 3 messages Jun 9, 2021 – Jun 24, 2021 ext4 file system

lore
Share & tools
lore

yangerkun

author
#0 lore raw

PATCH 1/1 ext4: no need to verify new add extent block

ext4_ext_grow_indepth will add a new extent block which has init the expected content. We can mark this buffer as verified so to stop a useless check in __read_extent_tree_block.

---
 fs/ext4/extents.c | 1 +
 1 file changed, 1 insertion(+)
fs/ext4/extents.c +1 -0
index cbf37b2cf871..6ca5be8a8fc2 100644
@@ -1306,6 +1306,7 @@ static int ext4_ext_grow_indepth(handle_t *handle, struct inode *inode,
 	neh->eh_magic = EXT4_EXT_MAGIC;
 	ext4_extent_block_csum_set(inode, neh);
 	set_buffer_uptodate(bh);
+	set_buffer_verified(bh);
 	unlock_buffer(bh);
 
 	err = ext4_handle_dirty_metadata(handle, inode, bh);
Signature · 1 line
2.31.1
reviewer Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · yangerkun

ext4_ext_grow_indepth will add a new extent block which has init the expected content. We can mark this buffer as verified so to stop a useless check in __read_extent_tree_block.

Looks good. Feel free to add:

Honza

Quoted 19 lines
---
 fs/ext4/extents.c | 1 +
 1 file changed, 1 insertion(+)
fs/ext4/extents.c +1 -0
index cbf37b2cf871..6ca5be8a8fc2 100644
@@ -1306,6 +1306,7 @@ static int ext4_ext_grow_indepth(handle_t *handle, struct inode *inode,
 	neh->eh_magic = EXT4_EXT_MAGIC;
 	ext4_extent_block_csum_set(inode, neh);
 	set_buffer_uptodate(bh);
+	set_buffer_verified(bh);
 	unlock_buffer(bh);
 
 	err = ext4_handle_dirty_metadata(handle, inode, bh);
Signature · 1 line
2.31.1
Signature · 2 lines
Jan Kara <[email protected]>
SUSE Labs, CR