We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1e1b28b commit ed94573Copy full SHA for ed94573
fs/ext4/inline.c
@@ -2002,6 +2002,18 @@ int ext4_convert_inline_data(struct inode *inode)
2002
if (!ext4_has_inline_data(inode)) {
2003
ext4_clear_inode_state(inode, EXT4_STATE_MAY_INLINE_DATA);
2004
return 0;
2005
+ } else if (!ext4_test_inode_state(inode, EXT4_STATE_MAY_INLINE_DATA)) {
2006
+ /*
2007
+ * Inode has inline data but EXT4_STATE_MAY_INLINE_DATA is
2008
+ * cleared. This means we are in the middle of moving of
2009
+ * inline data to delay allocated block. Just force writeout
2010
+ * here to finish conversion.
2011
+ */
2012
+ error = filemap_flush(inode->i_mapping);
2013
+ if (error)
2014
+ return error;
2015
+ if (!ext4_has_inline_data(inode))
2016
+ return 0;
2017
}
2018
2019
needed_blocks = ext4_writepage_trans_blocks(inode);
0 commit comments