]> git.baikalelectronics.ru Git - kernel.git/commit
Revert "ext4: use ext4_write_inode() when fsyncing w/o a journal"
authorTheodore Ts'o <tytso@mit.edu>
Fri, 1 Feb 2019 04:41:11 +0000 (23:41 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Fri, 1 Feb 2019 04:41:11 +0000 (23:41 -0500)
commite224db18918f8c0ad5ce9c318d4751225f201aa7
treeaeba8ce399b47836c4dc098962d6f711bec3b4af
parent607d144b83b16847bc18fb058d4d51857c4ff9c6
Revert "ext4: use ext4_write_inode() when fsyncing w/o a journal"

This reverts commit 8d77e69a5ecef983b44a9c7a80ca69ee6bbe039b.

As Jan Kara pointed out, this change was unsafe since it means we lose
the call to sync_mapping_buffers() in the nojournal case.  The
original point of the commit was avoid taking the inode mutex (since
it causes a lockdep warning in generic/113); but we need the mutex in
order to call sync_mapping_buffers().

The real fix to this problem was discussed here:

https://lore.kernel.org/lkml/20181025150540.259281-4-bvanassche@acm.org

The proposed patch was to fix a syzbot complaint, but the problem can
also demonstrated via "kvm-xfstests -c nojournal generic/113".
Multiple solutions were discused in the e-mail thread, but none have
landed in the kernel as of this writing.  Anyway, commit
8d77e69a5ecef9 is absolutely the wrong way to suppress the lockdep, so
revert it.

Fixes: 8d77e69a5ecef983b44a9c7a80ca69ee6bbe039b ("ext4: use ext4_write_inode() when fsyncing w/o a journal")
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reported: Jan Kara <jack@suse.cz>
fs/ext4/fsync.c