]> git.baikalelectronics.ru Git - kernel.git/commit
dm: fix missed error code if .end_io isn't implemented by target_type
authorzhendong chen <alex.chen@huawei.com>
Wed, 17 Dec 2014 06:37:04 +0000 (14:37 +0800)
committerMike Snitzer <snitzer@redhat.com>
Wed, 17 Dec 2014 17:31:13 +0000 (12:31 -0500)
commit70a94381f09bcc6d9abf41377fc1ce981406bea5
tree98355028eac1fb5f41623c95a6f1382154a240af
parenta4378e57e8a939388a993e8a03c071419034fb05
dm: fix missed error code if .end_io isn't implemented by target_type

In bio-based DM's clone_endio(), when target_type doesn't implement
.end_io (e.g. linear) r will be always be initialized 0.  So if a
WRITE SAME bio fails WRITE SAME will not be disabled as intended.

Fix this by initializing r to error, rather than 0, in clone_endio().

Signed-off-by: Alex Chen <alex.chen@huawei.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Fixes: 30b94368b9 ("dm: disable WRITE SAME if it fails")
Cc: stable@vger.kernel.org
drivers/md/dm.c