1. 21 5月, 2012 10 次提交
  2. 09 3月, 2012 3 次提交
  3. 30 11月, 2011 1 次提交
  4. 21 9月, 2011 1 次提交
  5. 19 10月, 2010 2 次提交
    • A
      UBI: preserve corrupted PEBs · 5fc01ab6
      Artem Bityutskiy 提交于
      Currently UBI erases all corrupted eraseblocks, irrespectively of the nature
      of corruption: corruption due to power cuts and non-power cut corruption.
      The former case is OK, but the latter is not, because UBI may destroy
      potentially important data.
      
      With this patch, during scanning, when UBI hits a PEB with corrupted VID
      header, it checks whether this PEB contains only 0xFF data. If yes, it is
      safe to erase this PEB and it is put to the 'erase' list. If not, this may
      be important data and it is better to avoid erasing this PEB. Instead,
      UBI puts it to the corr list and moves out of the pool of available PEB.
      IOW, UBI preserves this PEB.
      
      Such corrupted PEB lessen the amount of available PEBs. So the more of them
      we accumulate, the less PEBs are available. The maximum amount of non-power
      cut corrupted PEBs is 8.
      
      This patch is a response to UBIFS problem where reporter
      (Matthew L. Creech <mlcreech@gmail.com>) observes that UBIFS index points
      to an unmapped LEB. The theory is that corresponding PEB somehow got
      corrupted and UBI wiped it. This patch (actually a series of patches)
      tries to make sure such PEBs are preserved - this would make it is easier
      to analyze the corruption.
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      5fc01ab6
    • A
      UBI: rename IO error code · 756e1df1
      Artem Bityutskiy 提交于
      Rename UBI_IO_BAD_HDR_READ into UBI_IO_BAD_HDR_EBADMSG which is presumably more
      self-documenting and readable. Indeed, the '_READ' suffix does not tell much and
      even confuses, while '_EBADMSG' tells about uncorrectable ECC error, because we
      use -EBADMSG all over the place to represent ECC errors.
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      756e1df1
  6. 02 8月, 2010 1 次提交
    • A
      UBI: do not warn unnecessarily · 64d4b4c9
      Artem Bityutskiy 提交于
      Currently, when UBI attaches an MTD device and cannot reserve all 1% (by
      default) of PEBs for bad eraseblocks handling, it prints a warning. However,
      Matthew L. Creech <mlcreech@gmail.com> is not very happy to see this warning,
      because he did reserve enough of PEB at the beginning, but with time some
      PEBs became bad. The warning is not necessary in this case.
      
      This patch makes UBI print the warning
       o if this is a new image
       o of this is used image and the amount of reserved PEBs is only 10% (or less)
         of the size of the reserved PEB pool.
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      64d4b4c9
  7. 04 6月, 2010 2 次提交
  8. 21 9月, 2009 1 次提交
  9. 25 7月, 2009 1 次提交
  10. 10 6月, 2009 2 次提交
    • A
      UBI: handle more error codes · 6b5c94c6
      Artem Bityutskiy 提交于
      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: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      6b5c94c6
    • A
      UBI: fix multiple spelling typos · 815bc5f8
      Artem Bityutskiy 提交于
      Some of the typos were indicated by Adrian Hunter,
      some by 'aspell'.
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      815bc5f8
  11. 02 6月, 2009 3 次提交
    • A
      UBI: do not switch to R/O mode on read errors · b86a2c56
      Artem Bityutskiy 提交于
      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: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      b86a2c56
    • A
      UBI: fix and clean-up error paths in WL worker · 87960c0b
      Artem Bityutskiy 提交于
      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: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      87960c0b
    • A
      UBI: introduce new constants · 90bf0265
      Artem Bityutskiy 提交于
      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: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      90bf0265
  12. 06 1月, 2009 1 次提交
  13. 05 12月, 2008 2 次提交
  14. 06 11月, 2008 1 次提交
  15. 24 7月, 2008 6 次提交
    • A
      UBI: fix checkpatch.pl errors and warnings · 9c9ec147
      Artem Bityutskiy 提交于
      Just out or curiousity ran checkpatch.pl for whole UBI,
      and discovered there are quite a few of stylistic issues.
      Fix them.
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      9c9ec147
    • A
      UBI: bugfix - do not torture PEB needlessly · 4d88de4b
      Artem Bityutskiy 提交于
      This is probably a copy-paste bug - we torture the old PEB
      in the atomic LEB change function, but we should not do this.
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      4d88de4b
    • A
      UBI: amend commentaries · 85c6e6e2
      Artem Bityutskiy 提交于
      Hch asked not to use "unit" for sub-systems, let it be so.
      Also some other commentaries modifications.
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      85c6e6e2
    • A
      UBI: fix LEB locking · 23add745
      Artem Bityutskiy 提交于
      leb_read_unlock() may be called simultaniously by several tasks.
      The would race at the following code:
      
       up_read(&le->mutex);
       if (free)
               kfree(le);
      
      And it is possible that one task frees 'le' before the other tasks
      do 'up_read()'. Fix this by doing up_read and free inside the
      'ubi->ltree' lock. Below it the oops we had because of this:
      
      BUG: spinlock bad magic on CPU#0, integck/7504
      BUG: unable to handle kernel paging request at 6b6b6c4f
      IP: [<c0211221>] spin_bug+0x5c/0xdb
      *pde = 00000000 Oops: 0000 [#1] PREEMPT SMP Modules linked in: ubifs ubi nandsim nand nand_ids nand_ecc video output
      
      Pid: 7504, comm: integck Not tainted (2.6.26-rc3ubifs26 #8)
      EIP: 0060:[<c0211221>] EFLAGS: 00010002 CPU: 0
      EIP is at spin_bug+0x5c/0xdb
      EAX: 00000032 EBX: 6b6b6b6b ECX: 6b6b6b6b EDX: f7f7ce30
      ESI: f76491dc EDI: c044f51f EBP: e8a736cc ESP: e8a736a8
      DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
      Process integck (pid: 7504, ti=e8a72000 task=f7f7ce30 task.ti=e8a72000)
      Stack: c044f754 c044f51f 00000000 f7f7d024 00001d50 00000001 f76491dc 00000296       f6df50e0 e8a736d8 c02112f0 f76491dc e8a736e8 c039157a f7d9e830 f76491d8       e8a7370c c020b975 f76491dc 00000296 f76491f8 00000000 f76491d8 00000000 Call Trace:
      [<c02112f0>] ? _raw_spin_unlock+0x50/0x7c
      [<c039157a>] ? _spin_unlock_irqrestore+0x20/0x58
      [<c020b975>] ? rwsem_wake+0x4b/0x122
      [<c0390e0a>] ? call_rwsem_wake+0xa/0xc
      [<c0139ee7>] ? up_read+0x28/0x31
      [<f8873b3c>] ? leb_read_unlock+0x73/0x7b [ubi]
      [<f88742a3>] ? ubi_eba_read_leb+0x195/0x2b0 [ubi]
      [<f8872a04>] ? ubi_leb_read+0xaf/0xf8 [ubi]
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      23add745
    • A
      UBI: fix memory leak · abc5e922
      Artem Bityutskiy 提交于
      ubi_free_volume() function sets ubi->volumes[] to NULL, so
      ubi_eba_close() is useless, it does not free what has to be freed.
      So zap it and free vol->eba_tbl at the volume release function.
      Pointed-out-by: NAdrian Hunter <ext-adrian.hunter@nokia.com>
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      abc5e922
    • K
      UBI: avoid unnecessary division operations · cadb40cc
      Kyungmin Park 提交于
      UBI already checks that @min io size is the power of 2 at io_init.
      It is save to use bit operations then.
      Signed-off-by: NKyungmin Park <kyungmin.park@samsung.com>
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      cadb40cc
  16. 25 1月, 2008 3 次提交
    • A
      UBI: handle zero-length case · 60c03153
      Artem Bityutskiy 提交于
      ubi_eba_atomic_leb_change() has to just map the LEB to a free PEB
      if data length is zero.
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      60c03153
    • A
      UBI: add layout volume information · 91f2d53c
      Artem Bityutskiy 提交于
      Add more information about layout volume to make userspace tools
      use the macros instead of constants. Also rename UBI_LAYOUT_VOL_ID
      to make it consistent with other macros.
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      91f2d53c
    • A
      UBI: add auto-resize feature · 4ccf8cff
      Artem Bityutskiy 提交于
      The problem: NAND flashes have different amount of initial bad physical
      eraseblocks (marked as bad by the manufacturer). For example, for 256MiB
      Samsung OneNAND flash there might be from 0 to 40 bad initial eraseblocks,
      which is about 2%. When UBI is used as the base system, one needs to know
      the exact amount of good physical eraseblocks, because this number is
      needed to create the UBI image which is put to the devices during
      production. But this number is not know, which forces us to use the
      minimum number of good physical eraseblocks. And UBI additionally
      reserves some percentage of physical eraseblocks for bad block handling
      (default is 1%), so we have 1-3% of PEBs reserved at the end, depending
      on the amount of initial bad PEBs. But it is desired to always have
      1% (or more, depending on the configuration).
      
      Solution: this patch adds an "auto-resize" flag to the volume table.
      The volume which has the "auto-resize" flag will automatically be re-sized
      (enlarged) on the first UBI initialization. UBI clears the flag when
      the volume is re-sized. Only one volume may have the "auto-resize" flag.
      
      So, the production UBI image may have one volume with "auto-resize"
      flag set, and its size is automatically adjusted on the first boot
      of the device.
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      4ccf8cff