1. 18 May, 2009 6 commits
    • Artem Bityutskiy's avatar
      UBI: add dump_stack in checking code · cfcf0ec8
      Artem Bityutskiy authored
      I am experiencing an error in 'paranoid_check_volume()'. Add
      dump_stack() there to make it easier to identify the reasons
      of the error.
      Signed-off-by: default avatarArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      cfcf0ec8
    • Artem Bityutskiy's avatar
      UBI: fix races in I/O debugging checks · ffb6b7e4
      Artem Bityutskiy authored
      When paranoid checs are enabled, the 'io_paral' test from the
      'mtd-utils' package fails. The symptoms are:
      
      UBI error: paranoid_check_all_ff: flash region at PEB 3973:512, length 15872 does not contain all 0xFF bytes
      UBI error: paranoid_check_all_ff: paranoid check failed for PEB 3973
      UBI: hex dump of the 512-16384 region
      
      It turned out to be a bug in the checking function. Suppose there
      are 2 tasks - A and B. Task A is the wear-levelling working
      ('wear_leveling_worker()'). It is reading the VID header to find
      which LEB this PEB belongs to. Say, task A is reading header
      of PEB X. Suppose PEB X is unmapped, and has no VID header.
      Task B is trying to write to PEB X.
      
      Task A: in 'ubi_io_read_vid_hdr()': reads the VID header from PEB X.
              The read data contain all 0xFF bytes.
      Task B: writes VID header and some data to PEB X
      Task A: assumes PEB X is empty, calls 'paranoid_check_all_ff()', which
              fails.
      
      The solution for this problem is to make 'paranoid_check_all_ff()'
      re-read the VID header, re-check it, and only if it is not there,
      check the rest. This now implemented by the 'paranoid_check_empty()'
      function.
      Signed-off-by: default avatarArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      ffb6b7e4
    • Artem Bityutskiy's avatar
      UBI: small debugging code optimization · 2cb81e21
      Artem Bityutskiy authored
      The @ubi->dbg_peb_buf is needed only when paranoid checks are
      enabled, not when debugging in general is enabled.
      Signed-off-by: default avatarArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      2cb81e21
    • Artem Bityutskiy's avatar
      UBI: improve debugging messages · e1cf7e6d
      Artem Bityutskiy authored
      Various minor improvements to the debugging messages which
      I found useful while hunting problems.
      Signed-off-by: default avatarArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      e1cf7e6d
    • Artem Bityutskiy's avatar
      UBI: re-name volumes_mutex to device_mutex · f089c0b2
      Artem Bityutskiy authored
      The mutex essencially protects the entire UBI device, so the
      old @volumes_mutex name is a little misleading.
      Signed-off-by: default avatarArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      f089c0b2
    • Artem Bityutskiy's avatar
      UBI: remove redundant mutex · 383d08e0
      Artem Bityutskiy authored
      The @mult_mutex does not serve any purpose. We already have
      @volumes_mutex and it is enough. The @volume mutex is pushed
      down to the 'ubi_rename_volumes()', because we want first
      to open all volumes in the exclusive mode, and then lock the
      mutex, just like all other ioctl's (remove, re-size, etc) do.
      Signed-off-by: default avatarArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      383d08e0
  2. 16 May, 2009 1 commit
  3. 15 May, 2009 33 commits