Commit d8a1c16d authored by Filipe Manana's avatar Filipe Manana Committed by Yifan Qiao
Browse files

btrfs: do not start and wait for delalloc on snapshot roots on transaction commit

mainline inclusion
from mainline-v5.11-rc1
commit 88090ad3
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/I94K22

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=88090ad36a64af1eb5b78d26b2ccd07eedae80b5



------------------------------------------------------

We do not need anymore to start writeback for delalloc of roots that are
being snapshotted and wait for it to complete. This was done in commit
609e804d ("Btrfs: fix file corruption after snapshotting due to mix
of buffered/DIO writes") to fix a type of file corruption where files in a
snapshot end up having their i_size updated in a non-ordered way, leaving
implicit file holes, when buffered IO writes that increase a file's size
are followed by direct IO writes that also increase the file's size.

This is not needed anymore because we now have a more generic mechanism
to prevent a non-ordered i_size update since commit 9ddc959e
("btrfs: use the file extent tree infrastructure"), which addresses this
scenario involving snapshots as well.

Reviewed-by: default avatarJosef Bacik <josef@toxicpanda.com>
Signed-off-by: default avatarFilipe Manana <fdmanana@suse.com>
Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
Signed-off-by: default avatarYifan Qiao <qiaoyifan4@huawei.com>
parent ebba5515
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment