Whamcloud - gitweb
libext2fs: during inlinedata expand, don't corrupt inode
authorDarrick J. Wong <darrick.wong@oracle.com>
Fri, 14 Mar 2014 13:28:13 +0000 (09:28 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Fri, 14 Mar 2014 13:28:14 +0000 (09:28 -0400)
commit179e3bd708251048980c845d0080de1ce79ef21a
treee1be22726665ad1d6d48822f9a9f530ffdbaefe8
parentcc7d12ac377458e17b520e431f5b54896be3e456
libext2fs: during inlinedata expand, don't corrupt inode

When expanding an inline data inode, it's possible that the reduction
in the size of the EA structures causes the freeing of the EA block,
which changes the inode.  If this happens, the local version of the
inode that ext2fs_inline_data_expand was modifying will be out of sync
with what's on the disk.  This local copy gets written out to disk
after a block allocation, at which point it's possible that the inode
EA block and logical block zero point to the same physical block,
which is bad news.

Therefore, write the local copy to disk before removing the inline
data EA, and reread it afterwards.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
lib/ext2fs/inline_data.c