We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0ab308d commit 73fd5b1Copy full SHA for 73fd5b1
fs/ext4/inline.c
@@ -2013,6 +2013,18 @@ int ext4_convert_inline_data(struct inode *inode)
2013
if (!ext4_has_inline_data(inode)) {
2014
ext4_clear_inode_state(inode, EXT4_STATE_MAY_INLINE_DATA);
2015
return 0;
2016
+ } else if (!ext4_test_inode_state(inode, EXT4_STATE_MAY_INLINE_DATA)) {
2017
+ /*
2018
+ * Inode has inline data but EXT4_STATE_MAY_INLINE_DATA is
2019
+ * cleared. This means we are in the middle of moving of
2020
+ * inline data to delay allocated block. Just force writeout
2021
+ * here to finish conversion.
2022
+ */
2023
+ error = filemap_flush(inode->i_mapping);
2024
+ if (error)
2025
+ return error;
2026
+ if (!ext4_has_inline_data(inode))
2027
+ return 0;
2028
}
2029
2030
needed_blocks = ext4_writepage_trans_blocks(inode);
0 commit comments