]> www.infradead.org Git - users/dwmw2/linux.git/commit
ext4: handle ext4_mark_inode_dirty errors
authorHarshad Shirwadkar <harshadshirwadkar@gmail.com>
Mon, 27 Apr 2020 01:34:37 +0000 (18:34 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 24 Jun 2020 15:49:03 +0000 (17:49 +0200)
commit2ade6388e146d9d5a6fb93f45b5ca48c38969e4e
treef43d6ad07577e7a662f0934da7eeda62ba922d4c
parentb5232e2ee8df85891514c73472cac09921e5d51d
ext4: handle ext4_mark_inode_dirty errors

[ Upstream commit 4209ae12b12265d475bba28634184423149bd14f ]

ext4_mark_inode_dirty() can fail for real reasons. Ignoring its return
value may lead ext4 to ignore real failures that would result in
corruption / crashes. Harden ext4_mark_inode_dirty error paths to fail
as soon as possible and return errors to the caller whenever
appropriate.

One of the possible scnearios when this bug could affected is that
while creating a new inode, its directory entry gets added
successfully but while writing the inode itself mark_inode_dirty
returns error which is ignored. This would result in inconsistency
that the directory entry points to a non-existent inode.

Ran gce-xfstests smoke tests and verified that there were no
regressions.

Signed-off-by: Harshad Shirwadkar <harshadshirwadkar@gmail.com>
Link: https://lore.kernel.org/r/20200427013438.219117-1-harshadshirwadkar@gmail.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Sasha Levin <sashal@kernel.org>
12 files changed:
fs/ext4/acl.c
fs/ext4/ext4.h
fs/ext4/ext4_jbd2.h
fs/ext4/extents.c
fs/ext4/file.c
fs/ext4/indirect.c
fs/ext4/inline.c
fs/ext4/inode.c
fs/ext4/migrate.c
fs/ext4/namei.c
fs/ext4/super.c
fs/ext4/xattr.c