Skip to content

Commit c1cf1d5

Browse files
Mark Tomlinsonmiquelraynal
authored andcommitted
mtd: mtdoops: Don't write panic data twice
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: 016c129 ("mtd: mtdoops: do not use mtd->panic_write directly") Signed-off-by: Mark Tomlinson <mark.tomlinson@alliedtelesis.co.nz> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20200903034217.23079-1-mark.tomlinson@alliedtelesis.co.nz
1 parent 3fbe507 commit c1cf1d5

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

drivers/mtd/mtdoops.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -279,12 +279,13 @@ static void mtdoops_do_dump(struct kmsg_dumper *dumper,
279279
kmsg_dump_get_buffer(dumper, true, cxt->oops_buf + MTDOOPS_HEADER_SIZE,
280280
record_size - MTDOOPS_HEADER_SIZE, NULL);
281281

282-
/* Panics must be written immediately */
283-
if (reason != KMSG_DUMP_OOPS)
282+
if (reason != KMSG_DUMP_OOPS) {
283+
/* Panics must be written immediately */
284284
mtdoops_write(cxt, 1);
285-
286-
/* For other cases, schedule work to write it "nicely" */
287-
schedule_work(&cxt->work_write);
285+
} else {
286+
/* For other cases, schedule work to write it "nicely" */
287+
schedule_work(&cxt->work_write);
288+
}
288289
}
289290

290291
static void mtdoops_notify_add(struct mtd_info *mtd)

0 commit comments

Comments
 (0)