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 @@ -2005,6 +2005,18 @@ int ext4_convert_inline_data(struct inode *inode)
2005
2005
if (!ext4_has_inline_data (inode )) {
2006
2006
ext4_clear_inode_state (inode , EXT4_STATE_MAY_INLINE_DATA );
2007
2007
return 0 ;
2008
+ } else if (!ext4_test_inode_state (inode , EXT4_STATE_MAY_INLINE_DATA )) {
2009
+ /*
2010
+ * Inode has inline data but EXT4_STATE_MAY_INLINE_DATA is
2011
+ * cleared. This means we are in the middle of moving of
2012
+ * inline data to delay allocated block. Just force writeout
2013
+ * here to finish conversion.
2014
+ */
2015
+ error = filemap_flush (inode -> i_mapping );
2016
+ if (error )
2017
+ return error ;
2018
+ if (!ext4_has_inline_data (inode ))
2019
+ return 0 ;
2008
2020
}
2009
2021
2010
2022
needed_blocks = ext4_writepage_trans_blocks (inode );
You can’t perform that action at this time.
0 commit comments