* [PATCH] block2mtd: dubious assignment
@ 2010-10-22 10:47 Nicolas Kaiser
2010-10-22 14:34 ` Jörn Engel
0 siblings, 1 reply; 3+ messages in thread
From: Nicolas Kaiser @ 2010-10-22 10:47 UTC (permalink / raw)
To: Joern Engel; +Cc: linux-mtd, linux-kernel
When block2mtd_erase fails, a duplicated assignment instantly
changes instr->state from MTD_ERASE_FAILED to MTD_ERASE_DONE.
It looks to me like this might not be intended, or is it?
Signed-off-by: Nicolas Kaiser <nikai@nikai.net>
---
drivers/mtd/devices/block2mtd.c | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/drivers/mtd/devices/block2mtd.c b/drivers/mtd/devices/block2mtd.c
index 9365186..2cf0cc6 100644
--- a/drivers/mtd/devices/block2mtd.c
+++ b/drivers/mtd/devices/block2mtd.c
@@ -91,7 +91,6 @@ static int block2mtd_erase(struct mtd_info *mtd, struct erase_info *instr)
} else
instr->state = MTD_ERASE_DONE;
- instr->state = MTD_ERASE_DONE;
mtd_erase_callback(instr);
return err;
}
--
1.7.2.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] block2mtd: dubious assignment
2010-10-22 10:47 [PATCH] block2mtd: dubious assignment Nicolas Kaiser
@ 2010-10-22 14:34 ` Jörn Engel
2010-10-22 16:13 ` Artem Bityutskiy
0 siblings, 1 reply; 3+ messages in thread
From: Jörn Engel @ 2010-10-22 14:34 UTC (permalink / raw)
To: Nicolas Kaiser; +Cc: linux-mtd, Joern Engel, linux-kernel
On Fri, 22 October 2010 12:47:24 +0200, Nicolas Kaiser wrote:
>
> When block2mtd_erase fails, a duplicated assignment instantly
> changes instr->state from MTD_ERASE_FAILED to MTD_ERASE_DONE.
>
> It looks to me like this might not be intended, or is it?
Definitely not. Just proves how well block device errors are tested.
> Signed-off-by: Nicolas Kaiser <nikai@nikai.net>
Acked-By: Joern Engel <joern@logfs.org>
Artem, can I leave this patch to you as well?
Jörn
--
Eighty percent of success is showing up.
-- Woody Allen
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] block2mtd: dubious assignment
2010-10-22 14:34 ` Jörn Engel
@ 2010-10-22 16:13 ` Artem Bityutskiy
0 siblings, 0 replies; 3+ messages in thread
From: Artem Bityutskiy @ 2010-10-22 16:13 UTC (permalink / raw)
To: Jörn Engel; +Cc: Nicolas Kaiser, linux-mtd, Joern Engel, linux-kernel
On Fri, 2010-10-22 at 16:34 +0200, Jörn Engel wrote:
> On Fri, 22 October 2010 12:47:24 +0200, Nicolas Kaiser wrote:
> >
> > When block2mtd_erase fails, a duplicated assignment instantly
> > changes instr->state from MTD_ERASE_FAILED to MTD_ERASE_DONE.
> >
> > It looks to me like this might not be intended, or is it?
>
> Definitely not. Just proves how well block device errors are tested.
>
> > Signed-off-by: Nicolas Kaiser <nikai@nikai.net>
> Acked-By: Joern Engel <joern@logfs.org>
>
> Artem, can I leave this patch to you as well?
Yes, I'll put it to my l2 tree of course, thanks.
--
Best Regards,
Artem Bityutskiy (Битюцкий Артём)
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-10-22 16:13 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-22 10:47 [PATCH] block2mtd: dubious assignment Nicolas Kaiser
2010-10-22 14:34 ` Jörn Engel
2010-10-22 16:13 ` Artem Bityutskiy
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).