You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
Merge git://git.infradead.org/mtd-2.6
* git://git.infradead.org/mtd-2.6: (120 commits) [MTD] Fix mtdoops.c compilation [MTD] [NOR] fix startup lock when using multiple nor flash chips [MTD] [DOC200x] eccbuf is statically defined and always evaluate to true [MTD] Fix maps/physmap.c compilation with CONFIG_PM [MTD] onenand: Add panic_write function to the onenand driver [MTD] mtdoops: Use the panic_write function when present [MTD] Add mtd panic_write function pointer [MTD] [NAND] Freescale enhanced Local Bus Controller FCM NAND support. [MTD] physmap.c: Add support for multiple resources [MTD] [NAND] Fix misparenthesization introduced by commit 78b65179... [MTD] [NAND] Fix Blackfin NFC ECC calculating bug with page size 512 bytes [MTD] [NAND] Remove wrong operation in PM function of the BF54x NFC driver [MTD] [NAND] Remove unused variable in plat_nand_remove [MTD] Unlocking all Intel flash that is locked on power up. [MTD] [NAND] at91_nand: Make mtdparts option can override board info [MTD] mtdoops: Various minor cleanups [MTD] mtdoops: Ensure sequential write to the buffer [MTD] mtdoops: Perform write operations in a workqueue [MTD] mtdoops: Add further error return code checking [MTD] [NOR] Test devtype, not definition in flash_probe(), drivers/mtd/devices/lart.c ...
This commit is contained in:
+15
-14
@@ -37,24 +37,25 @@ static int check_node_data(struct jffs2_sb_info *c, struct jffs2_tmp_dnode_info
|
||||
|
||||
BUG_ON(tn->csize == 0);
|
||||
|
||||
if (!jffs2_is_writebuffered(c))
|
||||
goto adj_acc;
|
||||
|
||||
/* Calculate how many bytes were already checked */
|
||||
ofs = ref_offset(ref) + sizeof(struct jffs2_raw_inode);
|
||||
len = ofs % c->wbuf_pagesize;
|
||||
if (likely(len))
|
||||
len = c->wbuf_pagesize - len;
|
||||
len = tn->csize;
|
||||
|
||||
if (len >= tn->csize) {
|
||||
dbg_readinode("no need to check node at %#08x, data length %u, data starts at %#08x - it has already been checked.\n",
|
||||
ref_offset(ref), tn->csize, ofs);
|
||||
goto adj_acc;
|
||||
if (jffs2_is_writebuffered(c)) {
|
||||
int adj = ofs % c->wbuf_pagesize;
|
||||
if (likely(adj))
|
||||
adj = c->wbuf_pagesize - adj;
|
||||
|
||||
if (adj >= tn->csize) {
|
||||
dbg_readinode("no need to check node at %#08x, data length %u, data starts at %#08x - it has already been checked.\n",
|
||||
ref_offset(ref), tn->csize, ofs);
|
||||
goto adj_acc;
|
||||
}
|
||||
|
||||
ofs += adj;
|
||||
len -= adj;
|
||||
}
|
||||
|
||||
ofs += len;
|
||||
len = tn->csize - len;
|
||||
|
||||
dbg_readinode("check node at %#08x, data length %u, partial CRC %#08x, correct CRC %#08x, data starts at %#08x, start checking from %#08x - %u bytes.\n",
|
||||
ref_offset(ref), tn->csize, tn->partial_crc, tn->data_crc, ofs - len, ofs, len);
|
||||
|
||||
@@ -63,7 +64,7 @@ static int check_node_data(struct jffs2_sb_info *c, struct jffs2_tmp_dnode_info
|
||||
* adding and jffs2_flash_read_end() interface. */
|
||||
if (c->mtd->point) {
|
||||
err = c->mtd->point(c->mtd, ofs, len, &retlen, &buffer);
|
||||
if (!err && retlen < tn->csize) {
|
||||
if (!err && retlen < len) {
|
||||
JFFS2_WARNING("MTD point returned len too short: %zu instead of %u.\n", retlen, tn->csize);
|
||||
c->mtd->unpoint(c->mtd, buffer, ofs, retlen);
|
||||
} else if (err)
|
||||
|
||||
Reference in New Issue
Block a user