1. 10 Jun, 2009 3 commits
    • Artem Bityutskiy's avatar
      UBI: handle more error codes · 6b5c94c6
      Artem Bityutskiy authored
      The UBIFS WL worker may encounter read errors and there is logic
      which makes a decision whether we should do one of:
      
      1. cancel the operation and move the PEB with the read errors to
         the 'erroneous' list;
      2. switch to R/O mode.
      
      ATM, only -EIO errors trigger 1., other errors trigger 2. The idea
      is that if we know we encountered an I/O error, do 1. Otherwise,
      we do not know how to react, and do 2., just in case. E.g., if
      the underlying driver became crazy because of a bug, we do not
      want to harm any data, and switch to R/O mode.
      
      This patch does 2 things:
      1. Makes sure reads from the source PEB always cause 1. This is
         more consistent with other reads which come from the upper
         layers and never cause R/O.
      2. Teaches UBI to do 1. also on -EBADMSG, UBI_IO_BAD_VID_HDR,
         -ENOMEM, and -ETIMEOUT. But this is only when reading the
         target PEB.
      
      This preblems were hunted by Adrian Hunter.
      Signed-off-by: default avatarArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      6b5c94c6
    • Artem Bityutskiy's avatar
      UBI: fix multiple spelling typos · 815bc5f8
      Artem Bityutskiy authored
      Some of the typos were indicated by Adrian Hunter,
      some by 'aspell'.
      Signed-off-by: default avatarArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      815bc5f8
    • Artem Bityutskiy's avatar
      UBI: fix kmem_cache_free on error patch · 21d08bbc
      Artem Bityutskiy authored
      'kmem_cache_free()' oopeses if NULL is passed, and there is
      one error-path place where UBI may call it with NULL object.
      This problem was pointed to by Adrian Hunter.
      Signed-off-by: default avatarArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      21d08bbc
  2. 09 Jun, 2009 1 commit
  3. 08 Jun, 2009 1 commit
  4. 03 Jun, 2009 1 commit
  5. 02 Jun, 2009 5 commits
    • Dmitry Pervushin's avatar
      UBI: remove built-in gluebi · 518ceef0
      Dmitry Pervushin authored
      Remove built-in gluebi support. This is a preparation for a
      standalone glubi module support
      Signed-off-by: default avatarDmitry Pervushin <dpervushin@embeddedalley.com>
      Signed-off-by: default avatarArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      518ceef0
    • Dmitry Pervushin's avatar
      UBI: add notification API · 0e0ee1cc
      Dmitry Pervushin authored
      UBI volume notifications are intended to create the API to get clients
      notified about volume creation/deletion, renaming and re-sizing. A
      client can subscribe to these notifications using 'ubi_volume_register()'
      and cancel the subscription using 'ubi_volume_unregister()'. When UBI
      volumes change, a blocking notifier is called. Clients also can request
      "added" events on all volumes that existed before client subscribed
      to the notifications.
      
      If we use notifications instead of calling functions like 'ubi_gluebi_xxx()',
      we can make the MTD emulation layer to be more flexible: build it as a
      separate module and load/unload it on demand.
      
      [Artem: many cleanups, rework locking, add "updated" event, provide
       device/volume info in notifiers]
      Signed-off-by: default avatarDmitry Pervushin <dpervushin@embeddedalley.com>
      Signed-off-by: default avatarArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      0e0ee1cc
    • Artem Bityutskiy's avatar
      UBI: do not switch to R/O mode on read errors · b86a2c56
      Artem Bityutskiy authored
      This patch improves UBI errors handling. ATM UBI switches to
      R/O mode when the WL worker fails to read the source PEB.
      This means that the upper layers (e.g., UBIFS) has no
      chances to unmap the erroneous PEB and fix the error.
      This patch changes this behaviour and makes UBI put PEBs
      like this into a separate RB-tree, thus preventing the
      WL worker from hitting the same read errors again and
      again.
      
      But there is a 10% limit on a maximum amount of PEBs like this.
      If there are too much of them, UBI switches to R/O mode.
      
      Additionally, this patch teaches UBI not to panic and
      switch to R/O mode if after a PEB has been copied, the
      target LEB cannot be read back. Instead, now UBI cancels
      the operation and schedules the target PEB for torturing.
      
      The error paths has been tested by ingecting errors
      into 'ubi_eba_copy_leb()'.
      Signed-off-by: default avatarArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      b86a2c56
    • Artem Bityutskiy's avatar
      UBI: fix and clean-up error paths in WL worker · 87960c0b
      Artem Bityutskiy authored
      This patch fixes the error path in the WL worker - in same cases
      UBI oopses when 'goto out_error' happens and e1 or e2 are NULL.
      This patch also cleans up the error paths a little. And I have
      tested nearly all error paths in the WL worker.
      Signed-off-by: default avatarArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      87960c0b
    • Artem Bityutskiy's avatar
      UBI: introduce new constants · 90bf0265
      Artem Bityutskiy authored
      This patch is a clean-up and a preparation for the following
      patches. It introduece constants for the return values of the
      'ubi_eba_copy_leb()' function.
      Signed-off-by: default avatarArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      90bf0265
  6. 26 May, 2009 1 commit
    • Artem Bityutskiy's avatar
      UBI: fix race condition · ddbd3b61
      Artem Bityutskiy authored
      This patch fixes a minor problem where we may fail to wake
      upe the UBI background thread. This is not fatal at all,
      it may just result at sligtly worse performace for a short
      period of time, just because the thread will be woken up
      when real I/O on the UBI starts.
      
      Anywey, the issue is the race condition between
      'ubi_attach_mtd_dev()' and 'ubi_thread()'. If we do not
      serialize them, the 'wake_up_process()' call may be done
      before 'ubi_thread()' went seep, but after it checked
      'ubi->thread_enabled'.
      
      This issue was spotted by Shin Hong <hongshin@gmail.com>
      Signed-off-by: default avatarArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      ddbd3b61
  7. 18 May, 2009 8 commits
  8. 16 May, 2009 1 commit
  9. 15 May, 2009 19 commits