328e17d8d942 ("md: Move sb writer loop to its own function")