1. 28 1月, 2015 3 次提交
  2. 07 11月, 2014 4 次提交
    • R
      UBI: Fix invalid vfree() · f38aed97
      Richard Weinberger 提交于
      The logic of vfree()'ing vol->upd_buf is tied to vol->updating.
      In ubi_start_update() vol->updating is set long before vmalloc()'ing
      vol->upd_buf. If we encounter a write failure in ubi_start_update()
      before vmalloc() the UBI device release function will try to vfree()
      vol->upd_buf because vol->updating is set.
      Fix this by allocating vol->upd_buf directly after setting vol->updating.
      
      Fixes:
      [   31.559338] UBI warning: vol_cdev_release: update of volume 2 not finished, volume is damaged
      [   31.559340] ------------[ cut here ]------------
      [   31.559343] WARNING: CPU: 1 PID: 2747 at mm/vmalloc.c:1446 __vunmap+0xe3/0x110()
      [   31.559344] Trying to vfree() nonexistent vm area (ffffc90001f2b000)
      [   31.559345] Modules linked in:
      [   31.565620]  0000000000000bba ffff88002a0cbdb0 ffffffff818f0497 ffff88003b9ba148
      [   31.566347]  ffff88002a0cbde0 ffffffff8156f515 ffff88003b9ba148 0000000000000bba
      [   31.567073]  0000000000000000 0000000000000000 ffff88002a0cbe88 ffffffff8156c10a
      [   31.567793] Call Trace:
      [   31.568034]  [<ffffffff818f0497>] dump_stack+0x4e/0x7a
      [   31.568510]  [<ffffffff8156f515>] ubi_io_write_vid_hdr+0x155/0x160
      [   31.569084]  [<ffffffff8156c10a>] ubi_eba_write_leb+0x23a/0x870
      [   31.569628]  [<ffffffff81569b36>] vol_cdev_write+0x226/0x380
      [   31.570155]  [<ffffffff81179265>] vfs_write+0xb5/0x1f0
      [   31.570627]  [<ffffffff81179f8a>] SyS_pwrite64+0x6a/0xa0
      [   31.571123]  [<ffffffff818fde12>] system_call_fastpath+0x16/0x1b
      
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NRichard Weinberger <richard@nod.at>
      Signed-off-by: NArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
      f38aed97
    • R
      UBI: Fix double free after do_sync_erase() · aa5ad3b6
      Richard Weinberger 提交于
      If the erase worker is unable to erase a PEB it will
      free the ubi_wl_entry itself.
      The failing ubi_wl_entry must not free()'d again after
      do_sync_erase() returns.
      
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NRichard Weinberger <richard@nod.at>
      Signed-off-by: NArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
      aa5ad3b6
    • R
      UBI: vtbl: Use ubi_eba_atomic_leb_change() · b81000b6
      Richard Weinberger 提交于
      This is more a cosmetic change than a fix.
      By using ubi_eba_atomic_leb_change()
      we can guarantee that the first VTBL record is always
      correct and we don't really need the second one anymore.
      But we have to keep the second one to not break anything.
      
      Artem: add a comment
      Signed-off-by: NRichard Weinberger <richard@nod.at>
      Signed-off-by: NArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
      b81000b6
    • T
      UBI: Extend UBI layer debug/messaging capabilities · 32608703
      Tanya Brokhman 提交于
      If there is more then one UBI device mounted, there is no way to
      distinguish between messages from different UBI devices.
      Add device number to all ubi layer message types.
      
      The R/O block driver messages were replaced by pr_* since
      ubi_device structure is not used by it.
      
      Amended a bit by Artem.
      Signed-off-by: NTanya Brokhman <tlinder@codeaurora.org>
      Signed-off-by: NArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
      32608703
  3. 03 10月, 2014 1 次提交
  4. 30 9月, 2014 1 次提交
  5. 26 9月, 2014 2 次提交
  6. 24 9月, 2014 1 次提交
  7. 19 9月, 2014 2 次提交
  8. 17 9月, 2014 4 次提交
  9. 16 9月, 2014 1 次提交
    • R
      UBI: add missing kmem_cache_free() in process_pool_aeb error path · 1bf1890e
      Richard Genoud 提交于
      I ran into this error after a ubiupdatevol, because I forgot to backport
      e9110361 UBI: fix the volumes tree sorting criteria.
      
      UBI error: process_pool_aeb: orphaned volume in fastmap pool
      UBI error: ubi_scan_fastmap: Attach by fastmap failed, doing a full scan!
      kmem_cache_destroy ubi_ainf_peb_slab: Slab cache still has objects
      CPU: 0 PID: 1 Comm: swapper Not tainted 3.14.18-00053-gf05cac8dbf85 #1
      [<c000d298>] (unwind_backtrace) from [<c000baa8>] (show_stack+0x10/0x14)
      [<c000baa8>] (show_stack) from [<c01b7a68>] (destroy_ai+0x230/0x244)
      [<c01b7a68>] (destroy_ai) from [<c01b8fd4>] (ubi_attach+0x98/0x1ec)
      [<c01b8fd4>] (ubi_attach) from [<c01ade90>] (ubi_attach_mtd_dev+0x2b8/0x868)
      [<c01ade90>] (ubi_attach_mtd_dev) from [<c038b510>] (ubi_init+0x1dc/0x2ac)
      [<c038b510>] (ubi_init) from [<c0008860>] (do_one_initcall+0x94/0x140)
      [<c0008860>] (do_one_initcall) from [<c037aadc>] (kernel_init_freeable+0xe8/0x1b0)
      [<c037aadc>] (kernel_init_freeable) from [<c02730ac>] (kernel_init+0x8/0xe4)
      [<c02730ac>] (kernel_init) from [<c00093f0>] (ret_from_fork+0x14/0x24)
      UBI: scanning is finished
      
      Freeing the cache in the error path fixes the Slab error.
      
      Tested on at91sam9g35 (3.14.18+fastmap backports)
      Signed-off-by: NRichard Genoud <richard.genoud@gmail.com>
      Cc: stable <stable@vger.kernel.org> # 3.10+
      1bf1890e
  10. 29 7月, 2014 1 次提交
  11. 28 7月, 2014 3 次提交
  12. 19 7月, 2014 1 次提交
    • R
      UBI: init_volumes: Ignore volumes with no LEBs · e8c235b0
      Richard Weinberger 提交于
      UBI assumes that ubi_attach_info will only contain ubi_ainf_volume
      structures for volumes with at least one LEB.
      In scanning mode this is true because UBI can nicely create a ubi_ainf_volume
      on demand while creating the EBA table.
      
      For fastmap this is not true, the fastmap on-flash structure has a list of
      all volumes, the ubi_ainf_volume structures are created from this list.
      So it can happen that an empty volume ends up in init_volumes().
      
      We can easely deal with that by looking into ->leb_count too.
      Signed-off-by: NRichard Weinberger <richard@nod.at>
      Signed-off-by: NArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
      e8c235b0
  13. 16 7月, 2014 1 次提交
  14. 01 7月, 2014 1 次提交
  15. 27 5月, 2014 1 次提交
  16. 13 5月, 2014 2 次提交
  17. 05 5月, 2014 3 次提交
  18. 16 4月, 2014 1 次提交
    • J
      block: remove struct request buffer member · b4f42e28
      Jens Axboe 提交于
      This was used in the olden days, back when onions were proper
      yellow. Basically it mapped to the current buffer to be
      transferred. With highmem being added more than a decade ago,
      most drivers map pages out of a bio, and rq->buffer isn't
      pointing at anything valid.
      
      Convert old style drivers to just use bio_data().
      
      For the discard payload use case, just reference the page
      in the bio.
      Signed-off-by: NJens Axboe <axboe@fb.com>
      b4f42e28
  19. 22 3月, 2014 1 次提交
  20. 11 3月, 2014 1 次提交
  21. 05 3月, 2014 2 次提交
  22. 04 3月, 2014 3 次提交