summaryrefslogtreecommitdiffstats
path: root/drivers/md/dm-linear.c
diff options
context:
space:
mode:
authorMikulas Patocka <mpatocka@redhat.com>2009-01-06 03:04:58 +0000
committerAlasdair G Kergon <agk@redhat.com>2009-01-06 03:04:58 +0000
commit10d3bd09a3c25df114f74f7f86e1b58d070bef32 (patch)
treea44e2fe5ccc5950b87a1d31849e5f0ac24fdcc16 /drivers/md/dm-linear.c
parentd460c65a6a9ec9e0d284864ec3a9a2d1b73f0e43 (diff)
downloadlinux-10d3bd09a3c25df114f74f7f86e1b58d070bef32.tar.gz
linux-10d3bd09a3c25df114f74f7f86e1b58d070bef32.tar.bz2
linux-10d3bd09a3c25df114f74f7f86e1b58d070bef32.zip
dm: consolidate target deregistration error handling
Change dm_unregister_target to return void and use BUG() for error reporting. dm_unregister_target can only fail because of programming bug in the target driver. It can't fail because of user's behavior or disk errors. This patch changes unregister_target to return void and use BUG if someone tries to unregister non-registered target or unregister target that is in use. This patch removes code duplication (testing of error codes in all dm targets) and reports bugs in just one place, in dm_unregister_target. In some target drivers, these return codes were ignored, which could lead to a situation where bugs could be missed. Signed-off-by: Mikulas Patocka <mpatocka@redhat.com> Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Diffstat (limited to 'drivers/md/dm-linear.c')
-rw-r--r--drivers/md/dm-linear.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/md/dm-linear.c b/drivers/md/dm-linear.c
index 44042becad8a..79fb53e51c70 100644
--- a/drivers/md/dm-linear.c
+++ b/drivers/md/dm-linear.c
@@ -156,8 +156,5 @@ int __init dm_linear_init(void)
void dm_linear_exit(void)
{
- int r = dm_unregister_target(&linear_target);
-
- if (r < 0)
- DMERR("unregister failed %d", r);
+ dm_unregister_target(&linear_target);
}