1. 19 7月, 2014 3 次提交
  2. 24 1月, 2014 1 次提交
  3. 31 8月, 2012 1 次提交
  4. 22 8月, 2012 1 次提交
  5. 21 5月, 2012 1 次提交
  6. 17 5月, 2012 2 次提交
  7. 29 2月, 2012 1 次提交
  8. 26 8月, 2011 1 次提交
  9. 08 7月, 2011 1 次提交
    • A
      UBIFS: fix master node recovery · 19495f70
      Anatolij Gustschin 提交于
      When the 1st LEB was unmapped and written but 2nd LEB not,
      the master node recovery doesn't succeed after power cut.
      We see following error when mounting UBIFS partition on NOR
      flash:
      
      UBIFS error (pid 1137): ubifs_recover_master_node: failed to recover master node
      
      Correct 2nd master node offset check is needed to fix the
      problem. If the 2nd master node is at the end in the 2nd LEB,
      first master node is used for recovery. When checking for this
      condition we should check whether the master node is exactly at
      the end of the LEB (without remaining empty space) or whether
      it is followed by an empty space less than the master node size.
      
      Artem: when the error happened, offs2 = 261120, sz = 512, c->leb_size = 262016.
      Signed-off-by: NAnatolij Gustschin <agust@denx.de>
      Signed-off-by: NArtem Bityutskiy <dedekind1@gmail.com>
      19495f70
  10. 04 7月, 2011 3 次提交
  11. 01 6月, 2011 3 次提交
    • A
      UBIFS: fix recovery broken by the previous recovery fix · da8b94ea
      Artem Bityutskiy 提交于
      Unfortunately, the recovery fix d1606a59b6be4ea392eabd40d1250aa1eeb19efb
      (UBIFS: fix extremely rare mount failure) broke recovery. This commit make
      UBIFS drop the last min. I/O unit in all journal heads, but this is needed only
      for the GC head. And this does not work for non-GC heads. For example, if
      suppose we have min. I/O units A and B, and A contains a valid node X, which
      was fsynced, and then a group of nodes Y which spans the rest of A and B. In
      this case we'll drop not only Y, but also X, which is obviously incorrect.
      
      This patch fixes the issue and additionally makes recovery to drop last min.
      I/O unit only for the GC head, and leave things as they have been for ages for
      the other heads - this is safer.
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      da8b94ea
    • A
      UBIFS: amend ubifs_recover_leb interface · efcfde54
      Artem Bityutskiy 提交于
      Instead of passing "grouped" parameter to 'ubifs_recover_leb()' which tells
      whether the nodes are grouped in the LEB to recover, pass the journal head
      number and let 'ubifs_recover_leb()' look at the journal head's 'grouped' flag.
      
      This patch is a preparation to a further fix where we'll need to know the
      journal head number for other purposes.
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      efcfde54
    • A
      UBIFS: supress false error messages · ab75950b
      Artem Bityutskiy 提交于
      Commit ab51afe05273741f72383529ef488aa1ea598ec6 was a good clean-up, but
      it introduced a regression - now UBIFS prints scary error messages during
      recovery on all corrupted nodes, even though the corruptions are expected
      (due to a power cut). This patch fixes the issue.
      
      Additionally fix a typo in a commentary introduced by the same commit.
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      ab75950b
  12. 16 5月, 2011 5 次提交
  13. 14 5月, 2011 8 次提交
  14. 21 4月, 2011 1 次提交
    • A
      UBIFS: fix master node recovery · 6e0d9fd3
      Artem Bityutskiy 提交于
      This patch fixes the following symptoms:
      1. Unmount UBIFS cleanly.
      2. Start mounting UBIFS R/W and have a power cut immediately
      3. Start mounting UBIFS R/O, this succeeds
      4. Try to re-mount UBIFS R/W - this fails immediately or later on,
         because UBIFS will write the master node to the flash area
         which has been written before.
      
      The analysis of the problem:
      
      1. UBIFS is unmounted cleanly, both copies of the master node are clean.
      2. UBIFS is being mounter R/W, starts changing master node copy 1, and
         a power cut happens. The copy N1 becomes corrupted.
      3. UBIFS is being mounted R/O. It notices the copy N1 is corrupted and
         reads copy N2. Copy N2 is clean.
      4. Because of R/O mode, UBIFS cannot recover copy 1.
      5. The mount code (ubifs_mount()) sees that the master node is clean,
         so it decides that no recovery is needed.
      6. We are re-mounting R/W. UBIFS believes no recovery is needed and
         starts updating the master node, but copy N1 is still corrupted
         and was not recovered!
      
      Fix this problem by marking the master node as dirty every time we
      recover it and we are in R/O mode. This forces further recovery and
      the UBIFS cleans-up the corruptions and recovers the copy N1 when
      re-mounting R/W later.
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      Cc: stable@kernel.org
      6e0d9fd3
  15. 08 3月, 2011 1 次提交
    • A
      UBIFS: use max_write_size during recovery · 2765df7d
      Artem Bityutskiy 提交于
      When recovering from unclean reboots UBIFS scans the journal and checks nodes.
      If a corrupted node is found, UBIFS tries to check if this is the last node
      in the LEB or not. This is is done by checking if there only 0xFF bytes
      starting from the next min. I/O unit. However, since now we write in
      c->max_write_size, we should actually check for 0xFFs starting from the
      next max. write unit.
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      2765df7d
  16. 08 2月, 2011 1 次提交
  17. 07 2月, 2011 1 次提交
  18. 17 10月, 2010 1 次提交
  19. 20 9月, 2010 1 次提交
    • A
      UBIFS: introduce new flags for RO mounts · 2ef13294
      Artem Bityutskiy 提交于
      Commit 2fde99cb "UBIFS: mark VFS SB RO too"
      introduced regression. This commit made UBIFS set the 'MS_RDONLY' flag in the
      VFS superblock when it switches to R/O mode due to an error. This was done
      to make VFS show the R/O UBIFS flag in /proc/mounts.
      
      However, several places in UBIFS relied on the 'MS_RDONLY' flag and assume this
      flag can only change when we re-mount. For example, 'ubifs_put_super()'.
      
      This patch introduces new UBIFS flag - 'c->ro_mount' which changes only when
      we re-mount, and preserves the way UBIFS was originally mounted (R/W or R/O).
      This allows us to de-initialize UBIFS cleanly in 'ubifs_put_super()'.
      
      This patch also changes all 'ubifs_assert(!c->ro_media)' assertions to
      'ubifs_assert(!c->ro_media && !c->ro_mount)', because we never should write
      anything if the FS was mounter R/O.
      
      All the places where we test for 'MS_RDONLY' flag in the VFS SB were changed
      and now we test the 'c->ro_mount' flag instead, because it preserves the
      original UBIFS mount type, unlike the 'MS_RDONLY' flag.
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      2ef13294
  20. 13 7月, 2010 1 次提交
    • A
      UBIFS: fix GC LEB recovery · 6fb4374f
      Artem Bityutskiy 提交于
      UBIFS tries to alway have an LEB reserved for GC, and stores it
      in c->gc_lnum. Besides, there is GC head which points to the current
      GC head LEB.
      
      In case of an unclean power cut, what may happen is that the GC head
      was switched to the reserved GC LEB (c->gc_lnum), but a new reserved
      GC LEB was not created yet. So, after an unclean reboot we may have
      no reserved GC LEB, and we need to find a new LEB for this.
      
      To do this, we find a dirty LEB which can fit the current GC head,
      move the data, unmap this dirty LEB, and it becomes our reserved GC
      LEB.
      
      However, if we cannot find a dirty enough LEB, we return failure,
      which is wrong, because we still can have free LEBs to use for
      the reserved GC LEB. This patch fixes the issue.
      
      This patch also fixes few typos in comments, which were spotted by
      aspell.
      
      Note, this patch fixes a real issue
      
      [   14.328117] UBIFS: recovery needed
      [   53.941378] UBIFS error (pid 462): ubifs_rcvry_gc_commit: could not find a dirty LEB
      [   89.606399] UBIFS: recovery completed
      [   89.609329] UBIFS assert failed in mount_ubifs at 1358 (pid 462)
      [   89.616165] [<c0026144>] (unwind_backtrace+0x0/0xe4) from [<c0125ce4>] (ubifs_fill_super+0x11d0/0x1c4c)
      [   89.625930] [<c0125ce4>] (ubifs_fill_super+0x11d0/0x1c4c) from [<c0126910>] (ubifs_get_sb+0x1b0/0x354)
      [   89.635696] [<c0126910>] (ubifs_get_sb+0x1b0/0x354) from [<c008a50c>] (vfs_kern_mount+0x50/0xe0)
      [   89.644485] [<c008a50c>] (vfs_kern_mount+0x50/0xe0) from [<c008a5e0>] (do_kern_mount+0x34/0xdc)
      [   89.653274] [<c008a5e0>] (do_kern_mount+0x34/0xdc) from [<c00a29d8>] (do_mount+0x148/0x7cc)
      [   89.662063] [<c00a29d8>] (do_mount+0x148/0x7cc) from [<c00a30f4>] (sys_mount+0x98/0xc8)
      [   89.670852] [<c00a30f4>] (sys_mount+0x98/0xc8) from [<c0021f40>] (ret_fast_syscall+0x0/0x28)
      
      which was reported here:
      http://article.gmane.org/gmane.linux.drivers.mtd/29923
      by Alexander Pazdnikov <pazdnikov@list.ru>
      Reported-by: NAlexander Pazdnikov <pazdnikov@list.ru>
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      Reviewed-by: NAdrian Hunter <adrian.hunter@nokia.com>
      6fb4374f
  21. 30 3月, 2010 1 次提交
    • T
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking... · 5a0e3ad6
      Tejun Heo 提交于
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h
      
      percpu.h is included by sched.h and module.h and thus ends up being
      included when building most .c files.  percpu.h includes slab.h which
      in turn includes gfp.h making everything defined by the two files
      universally available and complicating inclusion dependencies.
      
      percpu.h -> slab.h dependency is about to be removed.  Prepare for
      this change by updating users of gfp and slab facilities include those
      headers directly instead of assuming availability.  As this conversion
      needs to touch large number of source files, the following script is
      used as the basis of conversion.
      
        http://userweb.kernel.org/~tj/misc/slabh-sweep.py
      
      The script does the followings.
      
      * Scan files for gfp and slab usages and update includes such that
        only the necessary includes are there.  ie. if only gfp is used,
        gfp.h, if slab is used, slab.h.
      
      * When the script inserts a new include, it looks at the include
        blocks and try to put the new include such that its order conforms
        to its surrounding.  It's put in the include block which contains
        core kernel includes, in the same order that the rest are ordered -
        alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
        doesn't seem to be any matching order.
      
      * If the script can't find a place to put a new include (mostly
        because the file doesn't have fitting include block), it prints out
        an error message indicating which .h file needs to be added to the
        file.
      
      The conversion was done in the following steps.
      
      1. The initial automatic conversion of all .c files updated slightly
         over 4000 files, deleting around 700 includes and adding ~480 gfp.h
         and ~3000 slab.h inclusions.  The script emitted errors for ~400
         files.
      
      2. Each error was manually checked.  Some didn't need the inclusion,
         some needed manual addition while adding it to implementation .h or
         embedding .c file was more appropriate for others.  This step added
         inclusions to around 150 files.
      
      3. The script was run again and the output was compared to the edits
         from #2 to make sure no file was left behind.
      
      4. Several build tests were done and a couple of problems were fixed.
         e.g. lib/decompress_*.c used malloc/free() wrappers around slab
         APIs requiring slab.h to be added manually.
      
      5. The script was run on all .h files but without automatically
         editing them as sprinkling gfp.h and slab.h inclusions around .h
         files could easily lead to inclusion dependency hell.  Most gfp.h
         inclusion directives were ignored as stuff from gfp.h was usually
         wildly available and often used in preprocessor macros.  Each
         slab.h inclusion directive was examined and added manually as
         necessary.
      
      6. percpu.h was updated not to include slab.h.
      
      7. Build test were done on the following configurations and failures
         were fixed.  CONFIG_GCOV_KERNEL was turned off for all tests (as my
         distributed build env didn't work with gcov compiles) and a few
         more options had to be turned off depending on archs to make things
         build (like ipr on powerpc/64 which failed due to missing writeq).
      
         * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
         * powerpc and powerpc64 SMP allmodconfig
         * sparc and sparc64 SMP allmodconfig
         * ia64 SMP allmodconfig
         * s390 SMP allmodconfig
         * alpha SMP allmodconfig
         * um on x86_64 SMP allmodconfig
      
      8. percpu.h modifications were reverted so that it could be applied as
         a separate patch and serve as bisection point.
      
      Given the fact that I had only a couple of failures from tests on step
      6, I'm fairly confident about the coverage of this conversion patch.
      If there is a breakage, it's likely to be something in one of the arch
      headers which should be easily discoverable easily on most builds of
      the specific arch.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Guess-its-ok-by: NChristoph Lameter <cl@linux-foundation.org>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
      5a0e3ad6
  22. 04 12月, 2009 1 次提交