* Missing offset increment in scan_read_raw_oob()
@ 2012-05-11 17:51 Dmitry Maluka
2012-05-15 6:57 ` Artem Bityutskiy
2012-05-15 7:03 ` Artem Bityutskiy
0 siblings, 2 replies; 4+ messages in thread
From: Dmitry Maluka @ 2012-05-11 17:51 UTC (permalink / raw)
To: linux-mtd
It seems there is a bug in scan_read_raw_oob() in nand_bbt.c which
should cause wrong functioning of NAND_BBT_SCANALLPAGES option.
Possible fix (relies on offs passed page-aligned):
--- a/drivers/mtd/nand/nand_bbt.c
+++ b/drivers/mtd/nand/nand_bbt.c
@@ -324,6 +324,7 @@ static int scan_read_raw_oob(struct mtd_info *mtd,
uint8_t *buf, loff_t offs,
buf += mtd->oobsize + mtd->writesize;
len -= mtd->writesize;
+ offs += mtd->writesize;
}
return 0;
}
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: Missing offset increment in scan_read_raw_oob()
2012-05-11 17:51 Missing offset increment in scan_read_raw_oob() Dmitry Maluka
@ 2012-05-15 6:57 ` Artem Bityutskiy
2012-05-15 7:03 ` Artem Bityutskiy
1 sibling, 0 replies; 4+ messages in thread
From: Artem Bityutskiy @ 2012-05-15 6:57 UTC (permalink / raw)
To: Dmitry Maluka; +Cc: linux-mtd
[-- Attachment #1: Type: text/plain, Size: 782 bytes --]
On Fri, 2012-05-11 at 20:51 +0300, Dmitry Maluka wrote:
> It seems there is a bug in scan_read_raw_oob() in nand_bbt.c which
> should cause wrong functioning of NAND_BBT_SCANALLPAGES option.
>
> Possible fix (relies on offs passed page-aligned):
>
> --- a/drivers/mtd/nand/nand_bbt.c
> +++ b/drivers/mtd/nand/nand_bbt.c
> @@ -324,6 +324,7 @@ static int scan_read_raw_oob(struct mtd_info *mtd,
> uint8_t *buf, loff_t offs,
>
> buf += mtd->oobsize + mtd->writesize;
> len -= mtd->writesize;
> + offs += mtd->writesize;
> }
> return 0;
> }
Looks like a correct fix. Did you encounter a real bug and then spot
this issue, or you spot it by reading the code?
--
Best Regards,
Artem Bityutskiy
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Missing offset increment in scan_read_raw_oob()
2012-05-11 17:51 Missing offset increment in scan_read_raw_oob() Dmitry Maluka
2012-05-15 6:57 ` Artem Bityutskiy
@ 2012-05-15 7:03 ` Artem Bityutskiy
2012-05-15 8:04 ` Dmitry Maluka
1 sibling, 1 reply; 4+ messages in thread
From: Artem Bityutskiy @ 2012-05-15 7:03 UTC (permalink / raw)
To: Dmitry Maluka; +Cc: linux-mtd
[-- Attachment #1: Type: text/plain, Size: 568 bytes --]
On Fri, 2012-05-11 at 20:51 +0300, Dmitry Maluka wrote:
> It seems there is a bug in scan_read_raw_oob() in nand_bbt.c which
> should cause wrong functioning of NAND_BBT_SCANALLPAGES option.
>
> Possible fix (relies on offs passed page-aligned):
I pushed it to l2-mtd.git, but please, tell how you found this issue.
Also you did not provide signed-off-by - can I add this:
Signed-off-by: Dmitry Maluka <D.Maluka@adbglobal.com>
?
Also note, the patch was line-wrapped and did not apply, so I had to
amend it.
--
Best Regards,
Artem Bityutskiy
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Missing offset increment in scan_read_raw_oob()
2012-05-15 7:03 ` Artem Bityutskiy
@ 2012-05-15 8:04 ` Dmitry Maluka
0 siblings, 0 replies; 4+ messages in thread
From: Dmitry Maluka @ 2012-05-15 8:04 UTC (permalink / raw)
To: linux-mtd
On 05/15/2012 10:03 AM, Artem Bityutskiy wrote:
> I pushed it to l2-mtd.git, but please, tell how you found this issue.
Just by reading the code. I do not use NAND_BBT_SCANALLPAGES so I think
I couldn't face this bug.
> Also you did not provide signed-off-by - can I add this:
>
> Signed-off-by: Dmitry Maluka <D.Maluka@adbglobal.com>
>
> ?
>
> Also note, the patch was line-wrapped and did not apply, so I had to
> amend it.
Ok, no problem.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-05-15 8:04 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-11 17:51 Missing offset increment in scan_read_raw_oob() Dmitry Maluka
2012-05-15 6:57 ` Artem Bityutskiy
2012-05-15 7:03 ` Artem Bityutskiy
2012-05-15 8:04 ` Dmitry Maluka
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox