dm: do not override error code returned from dm_get_device()
authorVivek Goyal <vgoyal@redhat.com>
Fri, 31 Jul 2015 13:20:36 +0000 (09:20 -0400)
committerMike Snitzer <snitzer@redhat.com>
Wed, 12 Aug 2015 15:32:21 +0000 (11:32 -0400)
commite80d1c805a3b2f0ad2081369be5dc5deedd5ee59
tree9e1044dc46f00ac0e2c34f92c6c10189c89f0ce9
parentab37844d6169c2dd6f96e665b07b692ba1a4c180
dm: do not override error code returned from dm_get_device()

Some of the device mapper targets override the error code returned by
dm_get_device() and return either -EINVAL or -ENXIO.  There is nothing
gained by this override.  It is better to propagate the returned error
code unchanged to caller.

This work was motivated by hitting an issue where the underlying device
was busy but -EINVAL was being returned.  After this change we get
-EBUSY instead and it is easier to figure out the problem.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
drivers/md/dm-crypt.c
drivers/md/dm-delay.c
drivers/md/dm-flakey.c
drivers/md/dm-linear.c
drivers/md/dm-log-writes.c
drivers/md/dm-raid1.c
drivers/md/dm-stripe.c