1. 11 3月, 2011 2 次提交
    • A
      UBIFS: print max. index node size · 6342aaeb
      Artem Bityutskiy 提交于
      Improve debugging messages by printing the maximum index node size
      on mount.
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      6342aaeb
    • M
      UBIFS: handle allocation failures in UBIFS write path · d882962f
      Matthew L. Creech 提交于
      Running kernel 2.6.37, my PPC-based device occasionally gets an
      order-2 allocation failure in UBIFS, which causes the root FS to
      become unwritable:
      
      kswapd0: page allocation failure. order:2, mode:0x4050
      Call Trace:
      [c787dc30] [c00085b8] show_stack+0x7c/0x194 (unreliable)
      [c787dc70] [c0061aec] __alloc_pages_nodemask+0x4f0/0x57c
      [c787dd00] [c0061b98] __get_free_pages+0x20/0x50
      [c787dd10] [c00e4f88] ubifs_jnl_write_data+0x54/0x200
      [c787dd50] [c00e82d4] do_writepage+0x94/0x198
      [c787dd90] [c00675e4] shrink_page_list+0x40c/0x77c
      [c787de40] [c0067de0] shrink_inactive_list+0x1e0/0x370
      [c787de90] [c0068224] shrink_zone+0x2b4/0x2b8
      [c787df00] [c0068854] kswapd+0x408/0x5d4
      [c787dfb0] [c0037bcc] kthread+0x80/0x84
      [c787dff0] [c000ef44] kernel_thread+0x4c/0x68
      
      Similar problems were encountered last April by Tomasz Stanislawski:
      
      http://patchwork.ozlabs.org/patch/50965/
      
      This patch implements Artem's suggested fix: fall back to a
      mutex-protected static buffer, allocated at mount time.  I tested it
      by forcing execution down the failure path, and didn't see any ill
      effects.
      
      Artem: massaged the patch a little, improved it so that we'd not
      allocate the write reserve buffer when we are in R/O mode.
      Signed-off-by: NMatthew L. Creech <mlcreech@gmail.com>
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      d882962f
  2. 08 3月, 2011 2 次提交
  3. 18 1月, 2011 1 次提交
    • A
      UBIFS: introduce mounting flag · 18d1d7fb
      Artem Bityutskiy 提交于
      This is a preparational patch which removes the 'c->always_chk_crc' which was
      set during mounting and remounting to R/W mode and introduces 'c->mounting'
      flag which is set when mounting. Now the 'c->always_chk_crc' flag is the
      same as 'c->remounting_rw && c->mounting'.
      
      This patch is a preparation for the next one which will need to know when we
      are mounting and remounting to R/W mode, which is exactly what
      'c->always_chk_crc' effectively is, but its name does not suite the
      next patch. The other possibility would be to just re-name it, but then
      we'd end up with less logical flags coverage.
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      18d1d7fb
  4. 29 10月, 2010 1 次提交
  5. 21 10月, 2010 2 次提交
    • A
      UBIFS: do not forget to cancel timers · 3601ba27
      Artem Bityutskiy 提交于
      This is a bug-fix: when we unmount, and we are currently in R/O
      mode because of an error - we do not sync write-buffers, which
      means we also do not cancel write-buffer timers we may possibly
      have armed. This patch fixes the issue.
      
      The issue can easily be reproduced by enabling UBIFS failure debug
      mode (echo 4 > /sys/module/ubifs/parameters/debug_tsts) and
      unmounting as soon as a failure happen. At some point the system
      oopses because we have an armed hrtimer but UBIFS is unmounted
      already.
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      3601ba27
    • A
      UBIFS: remove a bit of unneeded code · 39037559
      Artem Bityutskiy 提交于
      This is a clean-up patch which:
      
      1. Removes explicite 'hrtimer_cancel()' after 'ubifs_wbuf_sync()' in
         'ubifs_remount_ro()', because the timers will be canceled by
         'ubifs_wbuf_sync()', no need to cancel them for the second time.
      2. Remove "if (c->jheads)" check from 'ubifs_put_super()', because
         at journal heads must always be allocated there, since we checked
         earlier that we were mounted R/W, and the olny situation when
         journal heads are not allocated is when mounter or re-mounted R/O.
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      39037559
  6. 28 9月, 2010 1 次提交
  7. 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
  8. 17 9月, 2010 1 次提交
    • A
      UBIFS: introduce new flag for RO due to errors · 2680d722
      Artem Bityutskiy 提交于
      The R/O state may have various reasons:
      
      1. The UBI volume is R/O
      2. The FS is mounted R/O
      3. The FS switched to R/O mode because of an error
      
      However, in UBIFS we have only one variable which represents cases
      1 and 3 - 'c->ro_media'. Indeed, we set this to 1 if we switch to
      R/O mode due to an error, and then we test it in many places to
      make sure that we stop writing as soon as the error happens.
      
      But this is very unclean. One consequence of this, for example, is
      that in 'ubifs_remount_fs()' we use 'c->ro_media' to check whether
      we are in R/O mode because on an error, and we print a message
      in this case. However, if we are in R/O mode because the media
      is R/O, our message is bogus.
      
      This patch introduces new flag - 'c->ro_error' which is set when
      we switch to R/O mode because of an error. It also changes all
      "if (c->ro_media)" checks to "if (c->ro_error)" checks, because
      this is what the checks actually mean. We do not need to check
      for 'c->ro_media' because if the UBI volume is in R/O mode, we
      do not allow R/W mounting, and now writes can happen. This is
      guaranteed by VFS. But it is good to double-check this, so this
      patch also adds many "ubifs_assert(!c->ro_media)" checks.
      
      In the 'ubifs_remount_fs()' function this patch makes a bit more
      changes - it fixes the error messages as well.
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      2680d722
  9. 10 8月, 2010 1 次提交
  10. 03 8月, 2010 1 次提交
  11. 12 6月, 2010 1 次提交
  12. 06 3月, 2010 1 次提交
  13. 16 12月, 2009 1 次提交
  14. 24 11月, 2009 1 次提交
  15. 16 9月, 2009 1 次提交
  16. 11 9月, 2009 2 次提交
  17. 10 9月, 2009 1 次提交
  18. 24 7月, 2009 2 次提交
  19. 05 7月, 2009 4 次提交
    • D
      UBIFS: allow more than one volume to be mounted · 7fcd9c3e
      Daniel Mack 提交于
      UBIFS uses a bdi device per volume, but does not care to hand out unique
      names to each of them. This causes an error when trying to mount more
      than one volumes. Append the UBI volume and device ID to avoid that.
      
      [Amended a bit by Artem Bityutskiy]
      Signed-off-by: NDaniel Mack <daniel@caiaq.de>
      Cc: Artem Bityutskiy <dedekind@infradead.org>
      Cc: Adrian Hunter <ext-adrian.hunter@nokia.com>
      Cc: linux-mtd@lists.infradead.org
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      7fcd9c3e
    • A
      UBIFS: fix assertion warning · 1fb8bd01
      Artem Bityutskiy 提交于
      When debugging is enabled and an unclean file-system is mounter,
      the following assertion is triggered:
      
      UBIFS assert failed in ubifs_tnc_start_commit at 805 (pid 1081)
      Call Trace:
      [cfaffbd0] [c0006cf8] show_stack+0x44/0x16c (unreliable)
      [cfaffc10] [c011b738] ubifs_tnc_start_commit+0xbb8/0xd18
      [cfaffc90] [c0112670] do_commit+0x150/0xa44
      [cfaffd10] [c0125234] ubifs_rcvry_gc_commit+0xd8/0x544
      [cfaffd60] [c0100e9c] ubifs_fill_super+0xe78/0x15f8
      [cfaffdf0] [c0102118] ubifs_get_sb+0x20c/0x320
      [cfaffe70] [c007f764] vfs_kern_mount+0x58/0xe0
      [cfaffe90] [c007f83c] do_kern_mount+0x40/0xf8
      [cfaffeb0] [c0095c24] do_mount+0x550/0x758
      [cfafff10] [c0095ebc] sys_mount+0x90/0xe0
      [cfafff40] [c000ed4c] ret_from_syscall+0x0/0x3c
      
      The reason is that we initialize 'c->min_leb_idx' early, and do
      not re-calculate it after journal replay.
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      1fb8bd01
    • A
      UBIFS: few spelling fixes · cb54ef8b
      Artem Bityutskiy 提交于
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      cb54ef8b
    • A
      UBIFS: slightly optimize write-buffer timer usage · 0b335b9d
      Artem Bityutskiy 提交于
      This patch adds the following minor optimization:
      
      1. If write-buffer does not use the timer, indicate it with the
         wbuf->no_timer variable, instead of using the wbuf->softlimit
         variable. This is better because wbuf->softlimit is of ktime_t
         type, and the ktime_to_ns function contains 64-bit multiplication.
      
      2. Do not call the 'hrtimer_cancel()' function for write-buffers
         which do not use timers.
      
      3. Do not cancel the timer in 'ubifs_put_super()' because the
         synchronization function does this.
      
      This patch also removes a confusing comment.
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      0b335b9d
  20. 16 6月, 2009 1 次提交
  21. 12 6月, 2009 3 次提交
  22. 08 6月, 2009 2 次提交
  23. 02 6月, 2009 1 次提交
  24. 26 5月, 2009 1 次提交
    • A
      UBIFS: use anonymous device · 7c83f5cb
      Artem Bityutskiy 提交于
      UBIFS has erroneuosly set 'sb->s_dev' to the UBI volume
      character device major/minor. This may lead to clashes
      if there is another FS mounted to a block device with
      the same major/minor numbers. User-space programs which
      use 'stat->st_dev' may get confused because of this.
      
      This problem was found by Al Viro. He also pointed the
      way to fix the problem - use 'set_anon_super()' and
      'kill_anon_super()' VFS helpers.
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      7c83f5cb
  25. 25 5月, 2009 1 次提交
  26. 09 5月, 2009 1 次提交
  27. 06 5月, 2009 1 次提交
  28. 28 3月, 2009 1 次提交
  29. 26 3月, 2009 1 次提交