JFFS2: Change DEFAULT_EMPTY_SCAN_SIZE to 256 Bytes
PATCH 5/7 JFFS2: Change DEFAULT_EMPTY_SCAN_SIZE to 256 Bytes
1/ Syncs up with jffs2 in the linux kernel:
If the first 256 Bytes is 0xff,we get the conclusion that the sector is empty.
--- fs/jffs2/jffs2_1pass.c | 11 ++++++----- fs/jffs2/jffs2_nand_1pass.c | 13 ++++++------- include/jffs2/jffs2.h | 2 ++ 3 files changed, 14 insertions(+), 12 deletions(-)
fs/jffs2/jffs2_1pass.c +6 -5
@@ -801,7 +801,7 @@ jffs2_1pass_read_inode(struct b_lists *pL, u32 inode, char *dest)#endif default :/* unknown */ -putLabeledWord ("UNKOWN COMPRESSION METHOD = " , jNode->compr); +putLabeledWord ("UNKNOWN COMPRESSION METHOD = " , jNode->compr);put_fl_mem (jNode, pL->readbuf);return -1 ;break ;
@@ -1442,8 +1442,6 @@ dump_dirents(struct b_lists *pL) }#endif -#define DEFAULT_EMPTY_SCAN_SIZE 4096 -static inline uint32_t EMPTY_SCAN_SIZE (uint32_t sector_size) {if (sector_size <DEFAULT_EMPTY_SCAN_SIZE )
@@ -1560,14 +1558,17 @@ jffs2_1pass_build_lists(struct part_info * part)/* We temporarily use 'ofs' as a pointer into the buffer/jeb */ ofs =0 ; -/* Scan only 4KiB of 0xFF before declaring it's empty */ +/* Scan only DEFAULT_EMPTY_SCAN_SIZE of 0xFF before declaring it's empty */ while (ofs <EMPTY_SCAN_SIZE (part->sector_size) && *(uint32_t *)(&buf[ofs]) ==0xFFFFFFFF ) ofs +=4 ; -if (ofs ==EMPTY_SCAN_SIZE (part->sector_size)) +if (ofs ==EMPTY_SCAN_SIZE (part->sector_size)) { +printf ("Block at 0x%08x is empty (erased)\n" , sector_ofs);continue ; + } +/* Now ofs is a complete physical flash offset as it always was... */ ofs += sector_ofs; prevofs = ofs -1 ;
fs/jffs2/jffs2_nand_1pass.c +6 -7
@@ -351,7 +351,7 @@ jffs2_1pass_read_inode(struct b_lists *pL, u32 ino, char *dest,#endif default :/* unknown */ -putLabeledWord ("UNKOWN COMPRESSION METHOD = " , inode->compr); +putLabeledWord ("UNKNOWN COMPRESSION METHOD = " , inode->compr);return -1 ; } }
@@ -789,7 +789,6 @@ jffs2_fill_scan_buf(nand_info_t *nand, unsigned char *buf,return 0 ; } -#define EMPTY_SCAN_SIZE 1024static u32 jffs2_1pass_build_lists (struct part_info * part) {
@@ -828,17 +827,17 @@ jffs2_1pass_build_lists(struct part_info * part)if (nand_block_isbad (nand, offset))continue ; -if (jffs2_fill_scan_buf (nand, buf, offset,EMPTY_SCAN_SIZE )) +if (jffs2_fill_scan_buf (nand, buf, offset,DEFAULT_EMPTY_SCAN_SIZE ))return 0 ; ofs =0 ; -/* Scan only 4KiB of 0xFF before declaring it's empty */ -while (ofs <EMPTY_SCAN_SIZE && *(uint32_t *)(&buf[ofs]) ==0xFFFFFFFF ) +/* Scan only DEFAULT_EMPTY_SCAN_SIZE of 0xFF before declaring it's empty */ +while (ofs <DEFAULT_EMPTY_SCAN_SIZE && *(uint32_t *)(&buf[ofs]) ==0xFFFFFFFF ) ofs +=4 ; -if (ofs ==EMPTY_SCAN_SIZE ) +if (ofs ==DEFAULT_EMPTY_SCAN_SIZE )continue ; -if (jffs2_fill_scan_buf (nand, buf +EMPTY_SCAN_SIZE , offset +EMPTY_SCAN_SIZE , sectorsize -EMPTY_SCAN_SIZE )) +if (jffs2_fill_scan_buf (nand, buf +DEFAULT_EMPTY_SCAN_SIZE , offset +DEFAULT_EMPTY_SCAN_SIZE , sectorsize -DEFAULT_EMPTY_SCAN_SIZE ))return 0 ; offset += ofs;
include/jffs2/jffs2.h +2 -0
@@ -51,6 +51,8 @@ CONFIG_JFFS2_SUMMARY is enabled.#endif #endif +#define DEFAULT_EMPTY_SCAN_SIZE 256 +#define JFFS2_SUPER_MAGIC 0x72b6/* Values we may expect to find in the 'magic' field */
Signature · 1 line
1.7.3.1.msysgit.0
PATCH 5/7 JFFS2: Change DEFAULT_EMPTY_SCAN_SIZE to 256 Bytes
Hi Baidu,
Quoted 16 lines
1/ Syncs up with jffs2 in the linux kernel:
If the first 256 Bytes is 0xff,we get the conclusion that the sector is empty.Signed-off-by Baidu Liu <[email protected]>--- fs/jffs2/jffs2_1pass.c | 11 ++++++----- fs/jffs2/jffs2_nand_1pass.c | 13 ++++++------- include/jffs2/jffs2.h | 2 ++ 3 files changed, 14 insertions(+), 12 deletions(-)fs/jffs2/jffs2_1pass.c +0
-0
fs/jffs2/jffs2_1pass.c jffs2_1pass_read_inode(struct b_lists *pL, u32 inode, char *dest) · line 807
Quoted 8 lines
fs/jffs2/jffs2_1pass.c +1
-1@@ -801,7 +801,7 @@ jffs2_1pass_read_inode(struct b_lists *pL, u32 inode, char *dest)#endif default :/* unknown */ -putLabeledWord ("UNKOWN COMPRESSION METHOD = " , jNode->compr); +putLabeledWord ("UNKNOWN COMPRESSION METHOD = " , jNode->compr);put_fl_mem (jNode, pL->readbuf);return -1 ;break ;
This typo change is not mentioned in the change log and really does not belong here. Please put it into a separate changeset.
[...]
fs/jffs2/jffs2_nand_1pass.c jffs2_1pass_read_inode(struct b_lists *pL, u32 ino, char *dest, · line 357
Quoted 13 lines
fs/jffs2/jffs2_nand_1pass.c +1
-1@@ -351,7 +351,7 @@ jffs2_1pass_read_inode(struct b_lists *pL, u32 ino, char *dest,#endif default :/* unknown */ -putLabeledWord ("UNKOWN COMPRESSION METHOD = " , inode->compr); +putLabeledWord ("UNKNOWN COMPRESSION METHOD = " , inode->compr);return -1 ; } }
Dito.
Cheers
Detlev
Signature · 8 lines
Ftpd never switches uid and euid, it uses setfsuid(2) instead. The
main reason is that uid switching has been exploited in several
breakins, but the sheer ugliness of uid switching counts too.
-- pure-ftpd(8)
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: dzu at denx.dePATCH 5/7 JFFS2: Change DEFAULT_EMPTY_SCAN_SIZE to 256 Bytes
Hi, Detlev :
Quoted 11 lines
Quoted 7 lines
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? default:
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? /* unknown */
- ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?putLabeledWord("UNKOWN COMPRESSION METHOD = ", jNode->compr);
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?putLabeledWord("UNKNOWN COMPRESSION METHOD = ", jNode->compr); ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?put_fl_mem(jNode, pL->readbuf);
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? return -1;
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? break;This typo change is not mentioned in the change log and really does not belong here. ?Please put it into a separate changeset.
This is just the typo error correction. Do you think we really need another patch?
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH 5/7 JFFS2: Change DEFAULT_EMPTY_SCAN_SIZE to 256 Bytes
Hi,Detlev
2011/4/30 Detlev Zundel <[email protected]>:
Quoted 17 lines
Hi Baidu,
Quoted 15 lines
Hi,Detlev
Quoted 12 lines
Quoted 9 lines
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? default:
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? /* unknown */
- ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?putLabeledWord("UNKOWN COMPRESSION METHOD = ", jNode->compr);
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?putLabeledWord("UNKNOWN COMPRESSION METHOD = ", jNode->compr);
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?put_fl_mem(jNode, pL->readbuf); ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? return -1;
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? break;This typo change is not mentioned in the change log and really does not belong here. ?Please put it into a separate changeset.
Quoted 7 lines
Quoted 2 lines
This is just the typo error correction. Do you think we really need another patch?
A patch description should include _all_ changes. ?Either you also put that change into the patch description or you make a separate change. Doing changes not described in the commit log are a good sign to show that one does not care what one does.
Yes, you are right. Add all the description in the commit log. But please firstly make this principle be applied for all guys submiting patch. Not just to the people rarely summitint patch. Be fair.
PATCH 5/7 JFFS2: Change DEFAULT_EMPTY_SCAN_SIZE to 256 Bytes
Dear Baidu Liu,
Quoted 10 lines · In message <[email protected]> you wrote:
Quoted 5 lines
A patch description should include _all_ changes. Either you also put that change into the patch description or you make a separate change. Doing changes not described in the commit log are a good sign to show that one does not care what one does.
Yes, you are right. Add all the description in the commit log. But please firstly make this principle be applied for all guys submiting patch. Not just to the people rarely summitint patch. Be fair.
We try to be. We realy strive hard to apply the same, consequent policy to all submitters. You may be "lucky" and have a poor patch slip though because nobody foundenough time for a thorough review, but this is the exception. Or should be. In any case, when a (new) problem gets noted, it has to be fixed.
Best regards,
Wolfgang Denk
Signature · 6 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
The night sky over the planet Krikkit is the least interesting sight
in the entire Universe.
- Douglas Adams _Life, the Universe, and Everything_