1. 03 6月, 2011 2 次提交
    • A
      UBIFS: fix memory leak on error path · 812eb258
      Artem Bityutskiy 提交于
      UBIFS leaks memory on error path in 'ubifs_jnl_update()' in case of write
      failure because it forgets to free the 'struct ubifs_dent_node *dent' object.
      Although the object is small, the alignment can make it large - e.g., 2KiB
      if the min. I/O unit is 2KiB.
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      Cc: stable@kernel.org
      812eb258
    • A
      UBIFS: fix shrinker object count reports · cf610bf4
      Artem Bityutskiy 提交于
      Sometimes VM asks the shrinker to return amount of objects it can shrink,
      and we return the ubifs_clean_zn_cnt in that case. However, it is possible
      that this counter is negative for a short period of time, due to the way
      UBIFS TNC code updates it. And I can observe the following warnings sometimes:
      
      shrink_slab: ubifs_shrinker+0x0/0x2b7 [ubifs] negative objects to delete nr=-8541616642706119788
      
      This patch makes sure UBIFS never returns negative count of objects.
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      Cc: stable@kernel.org
      cf610bf4
  2. 01 6月, 2011 4 次提交
    • A
      UBIFS: fix recovery broken by the previous recovery fix · da8b94ea
      Artem Bityutskiy 提交于
      Unfortunately, the recovery fix d1606a59b6be4ea392eabd40d1250aa1eeb19efb
      (UBIFS: fix extremely rare mount failure) broke recovery. This commit make
      UBIFS drop the last min. I/O unit in all journal heads, but this is needed only
      for the GC head. And this does not work for non-GC heads. For example, if
      suppose we have min. I/O units A and B, and A contains a valid node X, which
      was fsynced, and then a group of nodes Y which spans the rest of A and B. In
      this case we'll drop not only Y, but also X, which is obviously incorrect.
      
      This patch fixes the issue and additionally makes recovery to drop last min.
      I/O unit only for the GC head, and leave things as they have been for ages for
      the other heads - this is safer.
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      da8b94ea
    • A
      UBIFS: amend ubifs_recover_leb interface · efcfde54
      Artem Bityutskiy 提交于
      Instead of passing "grouped" parameter to 'ubifs_recover_leb()' which tells
      whether the nodes are grouped in the LEB to recover, pass the journal head
      number and let 'ubifs_recover_leb()' look at the journal head's 'grouped' flag.
      
      This patch is a preparation to a further fix where we'll need to know the
      journal head number for other purposes.
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      efcfde54
    • A
      UBIFS: introduce a "grouped" journal head flag · 1a0b0699
      Artem Bityutskiy 提交于
      Journal heads are different in a way how UBIFS writes nodes there. All normal
      journal heads receive grouped nodes, while the GC journal heads receives
      ungrouped nodes. This patch adds a 'grouped' flag to 'struct ubifs_jhead' which
      describes this property.
      
      This patch is a preparation to a further recovery fix.
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      1a0b0699
    • A
      UBIFS: supress false error messages · ab75950b
      Artem Bityutskiy 提交于
      Commit ab51afe05273741f72383529ef488aa1ea598ec6 was a good clean-up, but
      it introduced a regression - now UBIFS prints scary error messages during
      recovery on all corrupted nodes, even though the corruptions are expected
      (due to a power cut). This patch fixes the issue.
      
      Additionally fix a typo in a commentary introduced by the same commit.
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      ab75950b
  3. 30 5月, 2011 34 次提交