Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 593a1aa5 authored by Mark Tomlinson's avatar Mark Tomlinson Committed by Greg Kroah-Hartman
Browse files

mtd: mtdoops: Don't write panic data twice



[ Upstream commit c1cf1d57d1492235309111ea6a900940213a9166 ]

If calling mtdoops_write, don't also schedule work to be done later.

Although this appears to not be causing an issue, possibly because the
scheduled work will never get done, it is confusing.

Fixes: 016c1291 ("mtd: mtdoops: do not use mtd->panic_write directly")
Signed-off-by: default avatarMark Tomlinson <mark.tomlinson@alliedtelesis.co.nz>
Signed-off-by: default avatarMiquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20200903034217.23079-1-mark.tomlinson@alliedtelesis.co.nz


Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 5389496b
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -293,13 +293,14 @@ static void mtdoops_do_dump(struct kmsg_dumper *dumper,
	kmsg_dump_get_buffer(dumper, true, cxt->oops_buf + MTDOOPS_HEADER_SIZE,
			     record_size - MTDOOPS_HEADER_SIZE, NULL);

	if (reason != KMSG_DUMP_OOPS) {
		/* Panics must be written immediately */
	if (reason != KMSG_DUMP_OOPS)
		mtdoops_write(cxt, 1);

	} else {
		/* For other cases, schedule work to write it "nicely" */
		schedule_work(&cxt->work_write);
	}
}

static void mtdoops_notify_add(struct mtd_info *mtd)
{