1. 29 10月, 2010 1 次提交
  2. 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
  3. 28 9月, 2010 1 次提交
  4. 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
  5. 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
  6. 10 8月, 2010 1 次提交
  7. 03 8月, 2010 1 次提交
  8. 12 6月, 2010 1 次提交
  9. 06 3月, 2010 1 次提交
  10. 16 12月, 2009 1 次提交
  11. 24 11月, 2009 1 次提交
  12. 16 9月, 2009 1 次提交
  13. 11 9月, 2009 2 次提交
  14. 10 9月, 2009 1 次提交
  15. 24 7月, 2009 2 次提交
  16. 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
  17. 16 6月, 2009 1 次提交
  18. 12 6月, 2009 3 次提交
  19. 08 6月, 2009 2 次提交
  20. 02 6月, 2009 1 次提交
  21. 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
  22. 25 5月, 2009 1 次提交
  23. 09 5月, 2009 1 次提交
  24. 06 5月, 2009 1 次提交
  25. 28 3月, 2009 1 次提交
  26. 26 3月, 2009 1 次提交
  27. 21 3月, 2009 1 次提交
    • H
      UBIFS: fix compiler warnings · fcabb347
      Hunter Adrian 提交于
      fs/ubifs/super.c: In function ‘ubifs_show_options’:
      fs/ubifs/super.c:425: warning: format not a string literal and no format arguments
      fs/ubifs/super.c: In function ‘mount_ubifs’:
      fs/ubifs/super.c:1204: warning: format not a string literal and no format arguments
      fs/ubifs/super.c: In function ‘ubifs_remount_rw’:
      fs/ubifs/super.c:1557: warning: format not a string literal and no format arguments
      Signed-off-by: NAdrian Hunter <adrian.hunter@nokia.com>
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      fcabb347
  28. 16 3月, 2009 1 次提交
  29. 15 3月, 2009 1 次提交
  30. 29 1月, 2009 2 次提交
    • A
      UBIFS: remove fast unmounting · 27ad2799
      Artem Bityutskiy 提交于
      This UBIFS feature has never worked properly, and it was a mistake
      to add it because we simply have no use-cases. So, lets still accept
      the fast_unmount mount option, but ignore it. This does not change
      much, because UBIFS commit in sync_fs anyway, and sync_fs is called
      while unmounting.
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      27ad2799
    • A
      UBIFS: return sensible error codes · a2b9df3f
      Artem Bityutskiy 提交于
      When mounting/re-mounting, UBIFS returns EINVAL even if the ENOSPC
      or EROFS codes are are much better, just because we have not found
      references to ENOSPC/EROFS in mount (2) man pages. This patch
      changes this behaviour and makes UBIFS return real error code,
      because:
      
      1. It is just less confusing and more logical
      2. mount is not described in SuSv3, so it seems to be not really
         well-standartized
      3. we do not cover all cases, and any random undocumented in man
         pages error code may be returned anyway
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      a2b9df3f