[PATCH v2 4/5] md: skip ID_BITMAP_NONE when show available bitmap types

Su Yue <[email protected]>
Newsgroups gmane.linux.raid
Message-ID <[email protected]>
As none_bitmap_ops is introduced, ID_BITMAP_NONE should be skipped while
iterating md submodules, otherwise:

$ cat /sys/block/md0/md/bitmap_type
[none] bitmap llbitmap [none]

Signed-off-by: Su Yue <[email protected]>
---
 drivers/md/md.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/md/md.c b/drivers/md/md.c
index 55a95b227b83..20a953676319 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -4269,6 +4269,8 @@ bitmap_type_show(struct mddev *mddev, char *page)
 	xa_for_each(&md_submodule, i, head) {
 		if (head->type != MD_BITMAP)
 			continue;
+		if (head->id == ID_BITMAP_NONE)
+			continue;
 
 		if (mddev->bitmap_id == head->id)
 			len += sprintf(page + len, "[%s] ", head->name);
-- 
2.53.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.