[JFFS2] Fix calculation of potential summary marker offset on NOR flash.

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Tue May 30 04:59:02 EDT 2006


Commit:     13ba42df4a385d7b77d7aac32b93bdcd73e6d6e1
Parent:     f1a28c02843efcfcc41982149880bac3ac180234
Author:     David Woodhouse <dwmw2 at infradead.org>
AuthorDate: Tue May 30 08:59:34 2006 +0100
Commit:     David Woodhouse <dwmw2 at infradead.org>
CommitDate: Tue May 30 08:59:34 2006 +0100

    [JFFS2] Fix calculation of potential summary marker offset on NOR flash.
    
    Helps if we look _inside_ the buffer, rather than adding jeb->offset to
    it. Doh.
    
    Signed-off-by: David Woodhouse <dwmw2 at infradead.org>

 fs/jffs2/scan.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/jffs2/scan.c b/fs/jffs2/scan.c
index 42c1ff2..6161808 100644
--- a/fs/jffs2/scan.c
+++ b/fs/jffs2/scan.c
@@ -463,7 +463,7 @@ #endif
 	      
 		if (!buf_size) {
 			/* XIP case. Just look, point at the summary if it's there */
-			sm = (void *)buf + jeb->offset - sizeof(*sm);
+			sm = (void *)buf + c->sector_size - sizeof(*sm);
 			if (je32_to_cpu(sm->magic) == JFFS2_SUM_MAGIC) {
 				sumptr = buf + je32_to_cpu(sm->offset);
 				sumlen = c->sector_size - je32_to_cpu(sm->offset);



More information about the linux-mtd-cvs mailing list