1. 05 Apr, 2011 3 commits
    • Artem Bityutskiy's avatar
      UBIFS: fix assertion warnings · c88ac00c
      Artem Bityutskiy authored
      This patch fixes UBIFS assertion warnings like:
      
      UBIFS assert failed in ubifs_leb_unmap at 135 (pid 29365)
      Pid: 29365, comm: integck Tainted: G          I 2.6.37-ubi-2.6+ #34
      Call Trace:
       [<ffffffffa047c663>] ubifs_lpt_init+0x95e/0x9ee [ubifs]
       [<ffffffffa04623a7>] ubifs_remount_fs+0x2c7/0x762 [ubifs]
       [<ffffffff810f066e>] do_remount_sb+0xb6/0x101
       [<ffffffff81106ff4>] ? do_mount+0x191/0x78e
       [<ffffffff811070bb>] do_mount+0x258/0x78e
       [<ffffffff810da1e8>] ? alloc_pages_current+0xa2/0xc5
       [<ffffffff81107674>] sys_mount+0x83/0xbd
       [<ffffffff81009a12>] system_call_fastpath+0x16/0x1b
      
      They happen when we re-mount from R/O mode to R/W mode. While
      re-mounting, we write to the media, but we still have the c->ro_mount
      flag set. The fix is very simple - just clear the flag before
      starting re-mounting R/W.
      
      These warnings are caused by the following commit:
      2ef13294
      
      For -stable guys: this bug was introduced in 2.6.38, this is materieal
      for 2.6.38-stable.
      Signed-off-by: default avatarArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      Cc: stable@kernel.org [2.6.38]
      c88ac00c
    • Artem Bityutskiy's avatar
      UBIFS: fix oops on error path in read_pnode · 54acbaaa
      Artem Bityutskiy authored
      Thanks to coverity which spotted that UBIFS will oops if 'kmalloc()'
      in 'read_pnode()' fails and we dereference a NULL 'pnode' pointer
      when we 'goto out'.
      Signed-off-by: default avatarArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      Cc: stable@kernel.org
      54acbaaa
    • Artem Bityutskiy's avatar
      UBIFS: do not read flash unnecessarily · 8b229c76
      Artem Bityutskiy authored
      This fix makes the 'dbg_check_old_index()' function return
      immediately if debugging is disabled, instead of executing
      incorrect 'goto out' which causes UBIFS to:
      
      1. Allocate memory
      2. Read the flash
      
      On every commit. OK, we do not commit that often, but it is
      still silly to do unneeded I/O anyway.
      
      Credits to coverity for spotting this silly issue.
      Signed-off-by: default avatarArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      Cc: stable@kernel.org
      8b229c76
  2. 29 Mar, 2011 37 commits