]> git.baikalelectronics.ru Git - kernel.git/commit
ext4: mark inode dirty after converting inline directory
authorEric Biggers <ebiggers@google.com>
Wed, 15 Mar 2017 18:52:02 +0000 (14:52 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Wed, 15 Mar 2017 18:52:02 +0000 (14:52 -0400)
commit8fc680748f1ef2da501b201e3286a93e7d8794a0
tree26d37735efe205c438165802fc0b64c43b4cbfb1
parent1aa433d6df165a1350f1bf94a80ecf740fb399ff
ext4: mark inode dirty after converting inline directory

If ext4_convert_inline_data() was called on a directory with inline
data, the filesystem was left in an inconsistent state (as considered by
e2fsck) because the file size was not increased to cover the new block.
This happened because the inode was not marked dirty after i_disksize
was updated.  Fix this by marking the inode dirty at the end of
ext4_finish_convert_inline_dir().

This bug was probably not noticed before because most users mark the
inode dirty afterwards for other reasons.  But if userspace executed
FS_IOC_SET_ENCRYPTION_POLICY with invalid parameters, as exercised by
'kvm-xfstests -c adv generic/396', then the inode was never marked dirty
after updating i_disksize.

Cc: stable@vger.kernel.org # 3.10+
Fixes: a834ff28f8ad8d60248b0963b9654ad5c12d3d40
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
fs/ext4/inline.c