]> git.baikalelectronics.ru Git - kernel.git/commit
md/bitmap: clear bitmap if bitmap_create failed
authorGuoqing Jiang <gqjiang@suse.com>
Fri, 1 Apr 2016 09:08:49 +0000 (17:08 +0800)
committerShaohua Li <shli@fb.com>
Fri, 1 Apr 2016 20:05:50 +0000 (13:05 -0700)
commit139f962b9cc7f7c411dec8bc5329354865a77983
tree9c7b17f98a7838daa26c1573e7d393350aeab9a4
parentcffb1b8bc11c6be2dd6d7d91e818d928a59d8a84
md/bitmap: clear bitmap if bitmap_create failed

If bitmap_create returns an error, we need to call
either bitmap_destroy or bitmap_free to do clean up,
and the selection is based on mddev->bitmap is set
or not.

And the sysfs_put(bitmap->sysfs_can_clear) is moved
from bitmap_destroy to bitmap_free, and the comment
of bitmap_create is changed as well.

Signed-off-by: Guoqing Jiang <gqjiang@suse.com>
Signed-off-by: Shaohua Li <shli@fb.com>
drivers/md/bitmap.c