Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 27836
b: refs/heads/master
c: 010b06d
h: refs/heads/master
v: v3
  • Loading branch information
David Woodhouse committed May 21, 2006
1 parent cb413a6 commit 36a2588
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9167e0f811cbe28564c44a99c2f07b0ce5b368cf
refs/heads/master: 010b06d6d07d9fa5ea6070aa72bb3e0de1761ab7
21 changes: 17 additions & 4 deletions trunk/fs/jffs2/summary.c
Original file line number Diff line number Diff line change
Expand Up @@ -835,19 +835,32 @@ static int jffs2_sum_write_data(struct jffs2_sb_info *c, struct jffs2_eraseblock
spin_unlock(&c->erase_completion_lock);
ret = jffs2_flash_writev(c, vecs, 2, jeb->offset + c->sector_size -
jeb->free_size, &retlen, 0);
spin_lock(&c->erase_completion_lock);


if (ret || (retlen != infosize)) {
struct jffs2_raw_node_ref *ref;

JFFS2_WARNING("Write of %u bytes at 0x%08x failed. returned %d, retlen %zd\n",
infosize, jeb->offset + c->sector_size - jeb->free_size, ret, retlen);

/* Waste remaining space */
ref = jffs2_alloc_raw_node_ref();
if (ref) {
spin_lock(&c->erase_completion_lock);

ref->flash_offset = jeb->offset + c->sector_size - jeb->free_size;
ref->flash_offset |= REF_OBSOLETE;
ref->next_in_ino = 0;

jffs2_link_node_ref(c, jeb, ref, c->sector_size - jeb->free_size);
}

c->summary->sum_size = JFFS2_SUMMARY_NOSUM_SIZE;
jffs2_scan_dirty_space(c, jeb, infosize);

return 1;
}

spin_lock(&c->erase_completion_lock);

return 0;
}

Expand Down Expand Up @@ -890,7 +903,6 @@ int jffs2_sum_write_sumnode(struct jffs2_sb_info *c)
/* for ACCT_PARANOIA_CHECK */
spin_unlock(&c->erase_completion_lock);
summary_ref = jffs2_alloc_raw_node_ref();
spin_lock(&c->erase_completion_lock);

if (!summary_ref) {
JFFS2_NOTICE("Failed to allocate node ref for summary\n");
Expand All @@ -900,6 +912,7 @@ int jffs2_sum_write_sumnode(struct jffs2_sb_info *c)
summary_ref->next_in_ino = NULL;
summary_ref->flash_offset = (jeb->offset + c->sector_size - jeb->free_size) | REF_NORMAL;

spin_lock(&c->erase_completion_lock);
jffs2_link_node_ref(c, jeb, summary_ref, infosize);

return 0;
Expand Down

0 comments on commit 36a2588

Please sign in to comment.