]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
dm log writes: make sure super sector log updates are written in order
authorzhangyi (F) <yi.zhang@huawei.com>
Wed, 5 Jun 2019 13:27:08 +0000 (21:27 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 3 Jul 2019 11:13:38 +0000 (13:13 +0200)
commit25df4ce382c963f0c28fefd0bcbd49bd44ce9fdc
treef29d63e0fa2b820a02ed31083f4d51cf1d62e1a1
parent6e17b11ffedd6e935c507c39b92e9c8ddb88c3c9
dm log writes: make sure super sector log updates are written in order

commit 211ad4b733037f66f9be0a79eade3da7ab11cbb8 upstream.

Currently, although we submit super bios in order (and super.nr_entries
is incremented by each logged entry), submit_bio() is async so each
super sector may not be written to log device in order and then the
final nr_entries may be smaller than it should be.

This problem can be reproduced by the xfstests generic/455 with ext4:

  QA output created by 455
 -Silence is golden
 +mark 'end' does not exist

Fix this by serializing submission of super sectors to make sure each
is written to the log disk in order.

Fixes: 0e9cebe724597 ("dm: add log writes target")
Cc: stable@vger.kernel.org
Signed-off-by: zhangyi (F) <yi.zhang@huawei.com>
Suggested-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/md/dm-log-writes.c