File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -2011,6 +2011,18 @@ int ext4_convert_inline_data(struct inode *inode)
2011
2011
if (!ext4_has_inline_data (inode )) {
2012
2012
ext4_clear_inode_state (inode , EXT4_STATE_MAY_INLINE_DATA );
2013
2013
return 0 ;
2014
+ } else if (!ext4_test_inode_state (inode , EXT4_STATE_MAY_INLINE_DATA )) {
2015
+ /*
2016
+ * Inode has inline data but EXT4_STATE_MAY_INLINE_DATA is
2017
+ * cleared. This means we are in the middle of moving of
2018
+ * inline data to delay allocated block. Just force writeout
2019
+ * here to finish conversion.
2020
+ */
2021
+ error = filemap_flush (inode -> i_mapping );
2022
+ if (error )
2023
+ return error ;
2024
+ if (!ext4_has_inline_data (inode ))
2025
+ return 0 ;
2014
2026
}
2015
2027
2016
2028
needed_blocks = ext4_writepage_trans_blocks (inode );
You can’t perform that action at this time.
0 commit comments