summaryrefslogtreecommitdiff
path: root/samples
diff options
context:
space:
mode:
authorThomas Betker <thomas.betker@rohde-schwarz.com>2020-03-30 08:30:16 +0300
committerJae Hyun Yoo <jae.hyun.yoo@linux.intel.com>2021-11-05 10:22:10 +0300
commitb6e77a3a63e9f76e9b7c8356384bba196503b2f6 (patch)
tree16db0a67a0c09c1e50b40f32550a5fee7b77df94 /samples
parent1c1a0672c696311e06de8ce407571e5de56a1939 (diff)
downloadlinux-b6e77a3a63e9f76e9b7c8356384bba196503b2f6.tar.xz
Fix for dirty node in jffs2 summary entry
jffs2_flash_direct_writev() always invokes jffs2_sum_add_kvec(), even if mtd_writev() fails. Usually, this results in an extra summary entry pointing to dirty node space, which should be ignored -- it is a bit of a waste, but harmless. When mtd_writev() returns *retlen == 0, though, the node space is not reserved as dirty, but re-used; the extra summary entry then points into the space of the next node. After the erase block has been closed, we get the following messages on remount: jffs2: error: (79) jffs2_link_node_ref: Adding new ref c3048d18 at (0x00ec5b88-0x00ec6bcc) not immediately after previous (0x00ec5b88-0x00ec5b88) ... jffs2: Checked all inodes but still 0x2088 bytes of unchecked space? jffs2: No space for garbage collection. Aborting GC thread The extra summary entries amount to "unchecked space", so that jffs2_garbage_collect_pass() returns -ENOSPC. And without garbage collection, the filesystem becomes unuseable over time as the erase blocks fill up. Fix this by skipping jffs2_sum_add_kvec() when the MTD write fails. We don't need the summary entry anyway, and the behaviour matches that of jffs2_flash_writev() in wbuf.c (with write buffering enabled). Signed-off-by: Thomas Betker <thomas.betker@rohde-schwarz.com>
Diffstat (limited to 'samples')
0 files changed, 0 insertions, 0 deletions