1. 29 9月, 2015 1 次提交
    • S
      UBI: return ENOSPC if no enough space available · 7c7feb2e
      shengyong 提交于
      UBI: attaching mtd1 to ubi0
      UBI: scanning is finished
      UBI error: init_volumes: not enough PEBs, required 706, available 686
      UBI error: ubi_wl_init: no enough physical eraseblocks (-20, need 1)
      UBI error: ubi_attach_mtd_dev: failed to attach mtd1, error -12 <= NOT ENOMEM
      UBI error: ubi_init: cannot attach mtd1
      
      If available PEBs are not enough when initializing volumes, return -ENOSPC
      directly. If available PEBs are not enough when initializing WL, return
      -ENOSPC instead of -ENOMEM.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: NSheng Yong <shengyong1@huawei.com>
      Signed-off-by: NRichard Weinberger <richard@nod.at>
      Reviewed-by: NDavid Gstir <david@sigma-star.at>
      7c7feb2e
  2. 03 6月, 2015 1 次提交
  3. 27 3月, 2015 15 次提交
  4. 26 3月, 2015 1 次提交
    • B
      UBI: initialize LEB number variable · f16db807
      Brian Norris 提交于
      In some of the 'out_not_moved' error paths, lnum may be used
      uninitialized. Don't ignore the warning; let's fix it.
      
      This uninitialized variable doesn't have much visible effect in the end,
      since we just schedule the PEB for erasure, and its LEB number doesn't
      really matter (it just gets printed in debug messages). But let's get it
      straight anyway.
      
      Coverity CID #113449
      
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
      Signed-off-by: NRichard Weinberger <richard@nod.at>
      f16db807
  5. 28 1月, 2015 1 次提交
  6. 07 11月, 2014 2 次提交
  7. 30 9月, 2014 1 次提交
  8. 26 9月, 2014 1 次提交
  9. 24 9月, 2014 1 次提交
  10. 29 7月, 2014 1 次提交
  11. 05 5月, 2014 2 次提交
  12. 04 10月, 2013 1 次提交
  13. 19 8月, 2013 1 次提交
  14. 10 12月, 2012 1 次提交
  15. 04 12月, 2012 2 次提交
  16. 30 11月, 2012 1 次提交
  17. 03 10月, 2012 2 次提交
  18. 04 9月, 2012 2 次提交
    • A
      UBI: print less · 719bb840
      Artem Bityutskiy 提交于
      UBI currently prints a lot of information when it mounts a volume, which
      bothers some people. Make it less chatty - print only important information
      by default.
      
      Get rid of 'dbg_msg()' macro completely.
      Reported-by: NUwe Kleine-König <u.kleine-koenig@pengutronix.de>
      Signed-off-by: NArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
      719bb840
    • S
      UBI: limit amount of reserved eraseblocks for bad PEB handling · 37f758a0
      Shmulik Ladkani 提交于
      The existing mechanism of reserving PEBs for bad PEB handling has two
      flaws:
      - It is calculated as a percentage of good PEBs instead of total PEBs.
      - There's no limit on the amount of PEBs UBI reserves for future bad
        eraseblock handling.
      
      This patch changes the mechanism to overcome these flaws.
      
      The desired level of PEBs reserved for bad PEB handling (beb_rsvd_level)
      is set to the maximum expected bad eraseblocks (bad_peb_limit) minus the
      existing number of bad eraseblocks (bad_peb_count).
      
      The actual amount of PEBs reserved for bad PEB handling is usually set
      to the desired level (but in some circumstances may be lower than the
      desired level, e.g. when attaching to a device that has too few
      available PEBs to satisfy the desired level).
      
      In the case where the device has too many bad PEBs (above the expected
      limit), then the desired level, and the actual amount of PEBs reserved
      are set to zero. No PEBs will be set aside for future bad eraseblock
      handling - even if some PEBs are made available (e.g. by shrinking a
      volume).
      If another PEB goes bad, and there are available PEBs, then the
      eraseblock will be marked bad (consuming one available PEB). But if
      there are no available PEBs, ubi will go into readonly mode.
      Signed-off-by: NShmulik Ladkani <shmulik.ladkani@gmail.com>
      37f758a0
  19. 07 6月, 2012 1 次提交
    • A
      UBI: correct ubi_wl_flush locking · 12027f1b
      Artem Bityutskiy 提交于
      Commit "62f38455 UBI: modify ubi_wl_flush function to clear work queue for a lnum"
      takes the 'work_sem' semaphore in write mode for the entire loop, which is not
      very good because it will block other workers for potentially long time. We do
      not need to have it in write mode - read mode is enough, and we do not need to
      hole it over the entire loop. So this patch turns changes the locking: takes
      'work_sem' in read mode and pushes it down to the loop.
      Signed-off-by: NArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
      12027f1b
  20. 21 5月, 2012 2 次提交
    • J
      UBI: modify ubi_wl_flush function to clear work queue for a lnum · 62f38455
      Joel Reardon 提交于
      This patch modifies ubi_wl_flush to force the erasure of
      particular volume id / logical eraseblock number pairs. Previous functionality
      is preserved when passing UBI_ALL for both values. The locations where ubi_wl_flush
      were called are appropriately changed: ubi_leb_erase only flushes for the
      erased LEB, and ubi_create_volume forces only flushing for its volume id.
      External code can call this new feature via the new function ubi_flush() added
      to kapi.c, which simply passes through to ubi_wl_flush().
      
      This was tested by disabling the call to do_work in ubi thread, which results
      in the work queue remaining unless explicitly called to remove. UBIFS was
      changed to call ubifs_leb_change 50 times for four different LEBs. Then the
      new function was called to clear the queue: passing wrong volume ids / lnum,
      correct ones, and finally UBI_ALL for both to ensure it was finally all
      cleard. The work queue was dumped each time and the selective removal
      of the particular LEB numbers was observed. Extra checks were enabled and
      ubifs's integck was also run. Finally, the drive was repeatedly filled and
      emptied to ensure that the queue was cleared normally.
      
      Artem: amended the patch.
      Signed-off-by: NJoel Reardon <reardonj@inf.ethz.ch>
      Signed-off-by: NArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
      62f38455
    • J
      UBI: add lnum and vol_id to struct ubi_work · d36e59e6
      Joel Reardon 提交于
      This is part of a multipart patch to allow UBI to force the erasure of
      particular logical eraseblock numbers. In this patch, the volume id and LEB
      number are added to ubi_work data structure, and both are also passed as a
      parameter to schedule erase to set it appropriately. Whenever ubi_wl_put_peb
      is called, the lnum is also passed to be forwarded to schedule erase. Later,
      a new ubi_sync_lnum will be added to execute immediately all work related to
      that lnum.
      
      This was tested by outputting the vol_id and lnum during the schedule of
      erasure. The ubi thread was disabled and two ubifs drives on separate
      partitions repeated changed a small number of LEBs. The ubi module was readded,
      and all the erased LEBs, corresponding to the volumes, were added to the
      schedule erase queue.
      
      Artem: minor tweaks
      Signed-off-by: NJoel Reardon <reardonj@inf.ethz.ch>
      Signed-off-by: NArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
      d36e59e6