All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH RESEND] dm-raid: Do not call BUG() in __rdev_sectors()
@ 2017-06-28  8:04 Hannes Reinecke
  2017-06-28 17:18 ` Mike Snitzer
  2017-06-29 14:09 ` Heinz Mauelshagen
  0 siblings, 2 replies; 5+ messages in thread
From: Hannes Reinecke @ 2017-06-28  8:04 UTC (permalink / raw)
  To: Mike Snitzer; +Cc: dm-devel, Hannes Reinecke

__rdev_sectors() might be called for an invalid/non-existing
RAID set during raid_ctr(), which is perfectly fine and no
reason to panic.

Signed-off-by: Hannes Reinecke <hare@suse.com>
---
 drivers/md/dm-raid.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/md/dm-raid.c b/drivers/md/dm-raid.c
index 7d89322..9bbb596 100644
--- a/drivers/md/dm-raid.c
+++ b/drivers/md/dm-raid.c
@@ -1571,7 +1571,8 @@ static sector_t __rdev_sectors(struct raid_set *rs)
 			return rdev->sectors;
 	}
 
-	BUG(); /* Constructor ensures we got some. */
+	/* No valid raid devices */
+	return 0;
 }
 
 /* Calculate the sectors per device and per array used for @rs */
-- 
1.8.5.6

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-06-30 12:33 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-28  8:04 [PATCH RESEND] dm-raid: Do not call BUG() in __rdev_sectors() Hannes Reinecke
2017-06-28 17:18 ` Mike Snitzer
2017-06-29 14:09 ` Heinz Mauelshagen
2017-06-30  7:33   ` Johannes Thumshirn
2017-06-30 12:33     ` Heinz Mauelshagen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.