1. 23 10月, 2010 4 次提交
    • R
      nilfs2: use checkpoint tree for mount check of snapshots · fd522029
      Ryusuke Konishi 提交于
      This rewrites nilfs_checkpoint_is_mounted() function so that it
      decides whether a checkpoint is mounted by whether the corresponding
      root object is found in checkpoint tree.
      Signed-off-by: NRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
      fd522029
    • R
      nilfs2: add checkpoint tree to nilfs object · ba65ae47
      Ryusuke Konishi 提交于
      To hold multiple versions of a filesystem in one sb instance, a new
      on-memory structure is necessary to handle one or more checkpoints.
      
      This adds a red-black tree of checkpoints to nilfs object, and adds
      lookup and create functions for them.
      
      Each checkpoint is represented by "nilfs_root" structure, and this
      structure has rb_node to configure the rb-tree.
      
      The nilfs_root object is identified with a checkpoint number.  For
      each snapshot, a nilfs_root object is allocated and the checkpoint
      number of snapshot is assigned to it.  For a regular mount
      (i.e. current mode mount), NILFS_CPTREE_CURRENT_CNO constant is
      assigned to the corresponding nilfs_root object.
      
      Each nilfs_root object has an ifile inode and some counters.  These
      items will displace those of nilfs_sb_info structure in successive
      patches.
      Signed-off-by: NRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
      ba65ae47
    • R
      nilfs2: remove own inode hash used for GC · 263d90ce
      Ryusuke Konishi 提交于
      This uses inode hash function that vfs provides instead of the own
      hash table for caching gc inodes.  This finally removes the own inode
      hash from nilfs.
      Signed-off-by: NRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
      263d90ce
    • R
      nilfs2: accept future revisions · 9566a7a8
      Ryusuke Konishi 提交于
      Compatibility of nilfs partitions is now managed with three feature
      sets.  This changes old compatibility check with revision number so
      that it can accept future revisions.
      
      Note that we can stop support of experimental versions of nilfs that
      doesn't know the feature sets by incrementing NILFS_CURRENT_REV.  We
      don't have to do it soon, but it would be a possible option whenever
      the need arises.
      Signed-off-by: NRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
      9566a7a8
  2. 30 8月, 2010 1 次提交
  3. 18 8月, 2010 1 次提交
  4. 16 8月, 2010 1 次提交
  5. 25 7月, 2010 1 次提交
    • R
      nilfs2: reject filesystem with unsupported block size · 89c0fd01
      Ryusuke Konishi 提交于
      This inserts sanity check that refuses to mount a filesystem with
      unsupported block size.
      
      Previously, kernel code of nilfs was looking only limitation of
      devices though mkfs.nilfs2 limits the range of block sizes; there was
      no check that prevents rec_len overflow with larger block sizes.
      
      With this change, block sizes larger than 64KB or smaller than 1KB
      will get rejected explicitly by kernel.
      Signed-off-by: NRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
      89c0fd01
  6. 23 7月, 2010 10 次提交
  7. 10 5月, 2010 1 次提交
    • R
      nilfs2: use checkpoint number instead of timestamp to select super block · 25294d8c
      Ryusuke Konishi 提交于
      Nilfs maintains two super blocks, and selects the new one on mount
      time if they both have valid checksums and their timestamps differ.
      
      However, this has potential for mis-selection since the system clock
      may be rewinded and the resolution of the timestamps is not high.
      
      Usually this doesn't become an issue because both super blocks are
      updated at the same time when the file system is unmounted.  Even if
      the file system wasn't unmounted cleanly, the roll-forward recovery
      will find the proper log which stores the latest super root.  Thus,
      the issue can appear only if update of one super block fails and the
      clock happens to be rewinded.
      
      This fixes the issue by using checkpoint numbers instead of timestamps
      to pick the super block storing the location of the latest log.
      Signed-off-by: NRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
      25294d8c
  8. 29 4月, 2010 1 次提交
  9. 14 3月, 2010 1 次提交
  10. 13 2月, 2010 1 次提交
  11. 20 11月, 2009 8 次提交
  12. 16 9月, 2009 1 次提交
  13. 14 9月, 2009 2 次提交
    • R
      nilfs2: remove individual gfp constants for each metadata file · 7a102b09
      Ryusuke Konishi 提交于
      This gets rid of NILFS_CPFILE_GFP, NILFS_SUFILE_GFP, NILFS_DAT_GFP,
      and NILFS_IFILE_GFP.  All of these constants refer to NILFS_MDT_GFP,
      and can be removed.
      Signed-off-by: NRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
      7a102b09
    • R
      nilfs2: use semaphore to protect pointer to a writable FS-instance · 027d6404
      Ryusuke Konishi 提交于
      will get rid of nilfs_get_writer() and nilfs_put_writer() pair used to
      retain a writable FS-instance for a period.
      
      The pair functions were making up some kind of recursive lock with a
      mutex, but they became overkill since the commit
      201913ed.  Furthermore, they caused
      the following lockdep warning because the mutex can be released by a
      task which didn't lock it:
      
       =====================================
       [ BUG: bad unlock balance detected! ]
       -------------------------------------
       kswapd0/422 is trying to release lock (&nilfs->ns_writer_mutex) at:
       [<c1359ff5>] mutex_unlock+0x8/0xa
       but there are no more locks to release!
      
       other info that might help us debug this:
       no locks held by kswapd0/422.
      
       stack backtrace:
       Pid: 422, comm: kswapd0 Not tainted 2.6.31-rc4-nilfs #51
       Call Trace:
        [<c1358f97>] ? printk+0xf/0x18
        [<c104fea7>] print_unlock_inbalance_bug+0xcc/0xd7
        [<c11578de>] ? prop_put_global+0x3/0x35
        [<c1050195>] lock_release+0xed/0x1dc
        [<c1359ff5>] ? mutex_unlock+0x8/0xa
        [<c1359f83>] __mutex_unlock_slowpath+0xaf/0x119
        [<c1359ff5>] mutex_unlock+0x8/0xa
        [<d1284add>] nilfs_mdt_write_page+0xd8/0xe1 [nilfs2]
        [<c1092653>] shrink_page_list+0x379/0x68d
        [<c109171b>] ? isolate_pages_global+0xb4/0x18c
        [<c1092bd2>] shrink_list+0x26b/0x54b
        [<c10930be>] shrink_zone+0x20c/0x2a2
        [<c10936b7>] kswapd+0x407/0x591
        [<c1091667>] ? isolate_pages_global+0x0/0x18c
        [<c1040603>] ? autoremove_wake_function+0x0/0x33
        [<c10932b0>] ? kswapd+0x0/0x591
        [<c104033b>] kthread+0x69/0x6e
        [<c10402d2>] ? kthread+0x0/0x6e
        [<c1003e33>] kernel_thread_helper+0x7/0x1a
      
      This patch uses a reader/writer semaphore instead of the own lock and
      kills this warning.
      Signed-off-by: NRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
      027d6404
  14. 12 6月, 2009 4 次提交
    • R
      nilfs2: get rid of bd_mount_sem use from nilfs · aa7dfb89
      Ryusuke Konishi 提交于
      This will remove every bd_mount_sem use in nilfs.
      
      The intended exclusion control was replaced by the previous patch
      ("nilfs2: correct exclusion control in nilfs_remount function") for
      nilfs_remount(), and this patch will replace remains with a new mutex
      that this inserts in nilfs object.
      Signed-off-by: NRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
      Cc: Christoph Hellwig <hch@infradead.org>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      aa7dfb89
    • R
      nilfs2: correct exclusion control in nilfs_remount function · e59399d0
      Ryusuke Konishi 提交于
      nilfs_remount() changes mount state of a superblock instance.  Even
      though nilfs accesses other superblock instances during mount or
      remount, the mount state was not properly protected in
      nilfs_remount().
      
      Moreover, nilfs_remount() has a lock order reversal problem;
      nilfs_get_sb() holds:
      
        1. bdev->bd_mount_sem
        2. sb->s_umount  (sget acquires)
      
      and nilfs_remount() holds:
      
        1. sb->s_umount  (locked by the caller in vfs)
        2. bdev->bd_mount_sem
      
      To avoid these problems, this patch divides a semaphore protecting
      super block instances from nilfs->ns_sem, and applies it to the mount
      state protection in nilfs_remount().
      
      With this change, bd_mount_sem use is removed from nilfs_remount() and
      the lock order reversal will be resolved.  And the new rw-semaphore,
      nilfs->ns_super_sem will properly protect the mount state except the
      modification from nilfs_error function.
      Signed-off-by: NRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      e59399d0
    • R
      nilfs2: simplify remaining sget() use · 6dd47406
      Ryusuke Konishi 提交于
      This simplifies the test function passed on the remaining sget()
      callsite in nilfs.
      
      Instead of checking mount type (i.e. ro-mount/rw-mount/snapshot mount)
      in the test function passed to sget(), this patch first looks up the
      nilfs_sb_info struct which the given mount type matches, and then
      acquires the super block instance holding the nilfs_sb_info.
      Signed-off-by: NRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      6dd47406
    • R
      nilfs2: get rid of sget use for acquiring nilfs object · 33c8e57c
      Ryusuke Konishi 提交于
      This will change the way to obtain nilfs object in nilfs_get_sb()
      function.
      
      Previously, a preliminary sget() call was performed, and the nilfs
      object was acquired from a super block instance found by the sget()
      call.
      
      This patch, instead, instroduces a new dedicated function
      find_or_create_nilfs(); as the name implies, the function finds an
      existent nilfs object from a global list or creates a new one if no
      object is found on the device.
      Signed-off-by: NRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      33c8e57c
  15. 10 6月, 2009 1 次提交
  16. 23 5月, 2009 1 次提交
  17. 13 4月, 2009 1 次提交
    • R
      nilfs2: fix lockdep recursive locking warning on meta data files · c2698e50
      Ryusuke Konishi 提交于
      This fixes the following false detection of lockdep against nilfs meta
      data files:
      
      =============================================
      [ INFO: possible recursive locking detected ]
      2.6.29 #26
      ---------------------------------------------
      mount.nilfs2/4185 is trying to acquire lock:
       (&mi->mi_sem){----}, at: [<d0c7925b>] nilfs_sufile_get_stat+0x1e/0x105 [nilfs2]
       but task is already holding lock:
        (&mi->mi_sem){----}, at: [<d0c72026>] nilfs_count_free_blocks+0x48/0x84 [nilfs2]
      Signed-off-by: NRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
      c2698e50