1. 30 Aug, 2010 4 commits
    • Artem Bityutskiy's avatar
      UBI: do not oops when erroneous PEB is scheduled for scrubbing · d3f6e6c6
      Artem Bityutskiy authored
      When an erroneous PEB is scheduling for scrubbing, we end up with the
      following oops:
      
      [<c0162404>] (prot_queue_del+0x0/0x50) from [<c01635b4>] (ubi_wl_scrub_peb+0xec/0x13c)
      [<c01634c8>] (ubi_wl_scrub_peb+0x0/0x13c) from [<c01603bc>] (ubi_eba_read_leb+0x200/0x428)
      [<c01601bc>] (ubi_eba_read_leb+0x0/0x428) from [<c015e3c0>] (ubi_leb_read+0xe8/0x138)
      [<c015e2d8>] (ubi_leb_read+0x0/0x138) from [<c00d6918>] (ubifs_start_scan+0x7c/0xf4)
      [<c00d689c>] (ubifs_start_scan+0x0/0xf4) from [<c00e3650>] (ubifs_recover_leb+0x3c/0x730)
      [<c00e3614>] (ubifs_recover_leb+0x0/0x730) from [<c00e444c>] (ubifs_recover_log_leb+0xc8/0x2dc)
      [<c00e4384>] (ubifs_recover_log_leb+0x0/0x2dc) from [<c00d7c20>] (ubifs_replay_journal+0xb90/0x13a4)
      [<c00d7090>] (ubifs_replay_journal+0x0/0x13a4) from [<c00cdd68>] (ubifs_fill_super+0xb84/0x1054)
      [<c00cd1e4>] (ubifs_fill_super+0x0/0x1054) from [<c00ced04>] (ubifs_get_sb+0xc4/0x2ac)
      [<c00cec40>] (ubifs_get_sb+0x0/0x2ac) from [<c007f04c>] (vfs_kern_mount+0x58/0x94)
      [<c007eff4>] (vfs_kern_mount+0x0/0x94) from [<c007f0e8>] (do_kern_mount+0x40/0xe8)
      [<c007f0a8>] (do_kern_mount+0x0/0xe8) from [<c0095628>] (do_new_mount+0x68/0x8c)
      [<c00955c0>] (do_new_mount+0x0/0x8c) from [<c00957a8>] (do_mount+0x15c/0x1b8)
      [<c009564c>] (do_mount+0x0/0x1b8) from [<c0095890>] (sys_mount+0x8c/0xd4)
      [<c0095804>] (sys_mount+0x0/0xd4) from [<c0023c00>] (ret_fast_syscall+0x0/0x2c)
      Kernel panic - not syncing: Fatal exception
      
      The problem is that 'ubi_wl_scrub_peb()' does not expect that PEBs may
      be in the erroneous tree, which is a bug. This patch fixes the bug
      and adds corresponding check to 'ubi_wl_scrub_peb()'. Now it will simply
      ignore erroneous PEBs, instead of causing an oops.
      Reported-by: default avatarMatthieu CASTET <matthieu.castet@parrot.com>
      Signed-off-by: default avatarArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      d3f6e6c6
    • Randy Dunlap's avatar
      UBI: fix kconfig unmet dependency · 1deacd7a
      Randy Dunlap authored
      warning: (OPTPROBES && KPROBES && HAVE_OPTPROBES && !PREEMPT && DEBUG_KERNEL ||
      MTD_UBI_DEBUG && MTD && SYSFS && MTD_UBI || UBIFS_FS_DEBUG && MISC_FILESYSTEMS &&
      UBIFS_FS || LOCKDEP && DEBUG_KERNEL && TRACE_IRQFLAGS_SUPPORT &&
      STACKTRACE_SUPPORT && LOCKDEP_SUPPORT || LATENCYTOP && HAVE_LATENCYTOP_SUPPORT &&
      DEBUG_KERNEL && STACKTRACE_SUPPORT && PROC_FS) selects KALLSYMS_ALL
      which has unmet direct dependencies (DEBUG_KERNEL && KALLSYMS)
      Signed-off-by: default avatarRandy Dunlap <randy.dunlap@oracle.com>
      Signed-off-by: default avatarArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      1deacd7a
    • Artem Bityutskiy's avatar
      UBI: fix forward compatibility · 80c1c16f
      Artem Bityutskiy authored
      Commit 0798cea8 "UBI: improve corrupted flash handling"
      broke delet-compatible volumes handling - it introduced a limit of 8 eraseblocks which
      may be corrupted. And delete-compatible eraseblocks are added to the "corrupted" list,
      so if we'd have a large delete-compatible volume, UBI would refuse it.
      
      The fix is to add delete-compatible volumes to the erase list instead. Indeed, they are
      corrupted, we just have to erase them.
      Signed-off-by: default avatarArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      80c1c16f
    • Julia Lawall's avatar
      UBI: eliminate update of list_for_each_entry loop cursor · 01ebc12f
      Julia Lawall authored
      list_for_each_entry uses its first argument to move from one element to the
      next, so modifying it can break the iteration.  The variable re1 is already
      used within the loop as a temporary variable, and is not live here.
      
      The semantic match that finds this problem is as follows:
      (http://coccinelle.lip6.fr/)
      
      // <smpl>
      @r@
      iterator name list_for_each_entry;
      expression x,E;
      position p1,p2;
      @@
      
      list_for_each_entry@p1(x,...) { <... x =@p2 E ...> }
      
      @@
      expression x,E;
      position r.p1,r.p2;
      statement S;
      @@
      
      *x =@p2 E
      ...
      list_for_each_entry@p1(x,...) S
      // </smpl>
      Signed-off-by: default avatarJulia Lawall <julia@diku.dk>
      Signed-off-by: default avatarArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      01ebc12f
  2. 29 Aug, 2010 3 commits
  3. 28 Aug, 2010 28 commits
  4. 27 Aug, 2010 5 commits