1. 17 4月, 2015 8 次提交
  2. 12 4月, 2015 1 次提交
  3. 26 3月, 2015 1 次提交
  4. 13 3月, 2015 1 次提交
    • R
      nilfs2: fix deadlock of segment constructor during recovery · 283ee148
      Ryusuke Konishi 提交于
      According to a report from Yuxuan Shui, nilfs2 in kernel 3.19 got stuck
      during recovery at mount time.  The code path that caused the deadlock was
      as follows:
      
        nilfs_fill_super()
          load_nilfs()
            nilfs_salvage_orphan_logs()
              * Do roll-forwarding, attach segment constructor for recovery,
                and kick it.
      
              nilfs_segctor_thread()
                nilfs_segctor_thread_construct()
                 * A lock is held with nilfs_transaction_lock()
                   nilfs_segctor_do_construct()
                     nilfs_segctor_drop_written_files()
                       iput()
                         iput_final()
                           write_inode_now()
                             writeback_single_inode()
                               __writeback_single_inode()
                                 do_writepages()
                                   nilfs_writepage()
                                     nilfs_construct_dsync_segment()
                                       nilfs_transaction_lock() --> deadlock
      
      This can happen if commit 7ef3ff2f ("nilfs2: fix deadlock of segment
      constructor over I_SYNC flag") is applied and roll-forward recovery was
      performed at mount time.  The roll-forward recovery can happen if datasync
      write is done and the file system crashes immediately after that.  For
      instance, we can reproduce the issue with the following steps:
      
       < nilfs2 is mounted on /nilfs (device: /dev/sdb1) >
       # dd if=/dev/zero of=/nilfs/test bs=4k count=1 && sync
       # dd if=/dev/zero of=/nilfs/test conv=notrunc oflag=dsync bs=4k
       count=1 && reboot -nfh
       < the system will immediately reboot >
       # mount -t nilfs2 /dev/sdb1 /nilfs
      
      The deadlock occurs because iput() can run segment constructor through
      writeback_single_inode() if MS_ACTIVE flag is not set on sb->s_flags.  The
      above commit changed segment constructor so that it calls iput()
      asynchronously for inodes with i_nlink == 0, but that change was
      imperfect.
      
      This fixes the another deadlock by deferring iput() in segment constructor
      even for the case that mount is not finished, that is, for the case that
      MS_ACTIVE flag is not set.
      Signed-off-by: NRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
      Reported-by: NYuxuan Shui <yshuiv7@gmail.com>
      Tested-by: NRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      283ee148
  5. 01 3月, 2015 1 次提交
    • R
      nilfs2: fix potential memory overrun on inode · 957ed60b
      Ryusuke Konishi 提交于
      Each inode of nilfs2 stores a root node of a b-tree, and it turned out to
      have a memory overrun issue:
      
      Each b-tree node of nilfs2 stores a set of key-value pairs and the number
      of them (in "bn_nchildren" member of nilfs_btree_node struct), as well as
      a few other "bn_*" members.
      
      Since the value of "bn_nchildren" is used for operations on the key-values
      within the b-tree node, it can cause memory access overrun if a large
      number is incorrectly set to "bn_nchildren".
      
      For instance, nilfs_btree_node_lookup() function determines the range of
      binary search with it, and too large "bn_nchildren" leads
      nilfs_btree_node_get_key() in that function to overrun.
      
      As for intermediate b-tree nodes, this is prevented by a sanity check
      performed when each node is read from a drive, however, no sanity check
      has been done for root nodes stored in inodes.
      
      This patch fixes the issue by adding missing sanity check against b-tree
      root nodes so that it's called when on-memory inodes are read from ifile,
      inode metadata file.
      Signed-off-by: NRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      957ed60b
  6. 11 2月, 2015 1 次提交
  7. 06 2月, 2015 1 次提交
    • R
      nilfs2: fix deadlock of segment constructor over I_SYNC flag · 7ef3ff2f
      Ryusuke Konishi 提交于
      Nilfs2 eventually hangs in a stress test with fsstress program.  This
      issue was caused by the following deadlock over I_SYNC flag between
      nilfs_segctor_thread() and writeback_sb_inodes():
      
        nilfs_segctor_thread()
          nilfs_segctor_thread_construct()
            nilfs_segctor_unlock()
              nilfs_dispose_list()
                iput()
                  iput_final()
                    evict()
                      inode_wait_for_writeback()  * wait for I_SYNC flag
      
        writeback_sb_inodes()
           * set I_SYNC flag on inode->i_state
          __writeback_single_inode()
            do_writepages()
              nilfs_writepages()
                nilfs_construct_dsync_segment()
                  nilfs_segctor_sync()
                     * wait for completion of segment constructor
          inode_sync_complete()
             * clear I_SYNC flag after __writeback_single_inode() completed
      
      writeback_sb_inodes() calls do_writepages() for dirty inodes after
      setting I_SYNC flag on inode->i_state.  do_writepages() in turn calls
      nilfs_writepages(), which can run segment constructor and wait for its
      completion.  On the other hand, segment constructor calls iput(), which
      can call evict() and wait for the I_SYNC flag on
      inode_wait_for_writeback().
      
      Since segment constructor doesn't know when I_SYNC will be set, it
      cannot know whether iput() will block or not unless inode->i_nlink has a
      non-zero count.  We can prevent evict() from being called in iput() by
      implementing sop->drop_inode(), but it's not preferable to leave inodes
      with i_nlink == 0 for long periods because it even defers file
      truncation and inode deallocation.  So, this instead resolves the
      deadlock by calling iput() asynchronously with a workqueue for inodes
      with i_nlink == 0.
      Signed-off-by: NRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Tested-by: NRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      7ef3ff2f
  8. 21 1月, 2015 2 次提交
  9. 11 12月, 2014 3 次提交
    • R
      nilfs2: fix the nilfs_iget() vs. nilfs_new_inode() races · 705304a8
      Ryusuke Konishi 提交于
      Same story as in commit 41080b5a ("nfsd race fixes: ext2") (similar
      ext2 fix) except that nilfs2 needs to use insert_inode_locked4() instead
      of insert_inode_locked() and a bug of a check for dead inodes needs to
      be fixed.
      
      If nilfs_iget() is called from nfsd after nilfs_new_inode() calls
      insert_inode_locked4(), nilfs_iget() will wait for unlock_new_inode() at
      the end of nilfs_mkdir()/nilfs_create()/etc to unlock the inode.
      
      If nilfs_iget() is called before nilfs_new_inode() calls
      insert_inode_locked4(), it will create an in-core inode and read its
      data from the on-disk inode.  But, nilfs_iget() will find i_nlink equals
      zero and fail at nilfs_read_inode_common(), which will lead it to call
      iget_failed() and cleanly fail.
      
      However, this sanity check doesn't work as expected for reused on-disk
      inodes because they leave a non-zero value in i_mode field and it
      hinders the test of i_nlink.  This patch also fixes the issue by
      removing the test on i_mode that nilfs2 doesn't need.
      Signed-off-by: NRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      705304a8
    • M
      nilfs2: deletion of an unnecessary check before the function call "iput" · 72b9918e
      Markus Elfring 提交于
      The iput() function tests whether its argument is NULL and then returns
      immediately.  Thus the test around the call is not needed.
      
      This issue was detected by using the Coccinelle software.
      Signed-off-by: NMarkus Elfring <elfring@users.sourceforge.net>
      Signed-off-by: NRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      72b9918e
    • A
      nilfs2: avoid duplicate segment construction for fsync() · 75dc857c
      Andreas Rohner 提交于
      This patch removes filemap_write_and_wait_range() from nilfs_sync_file(),
      because it triggers a data segment construction by calling
      nilfs_writepages() with WB_SYNC_ALL.  A data segment construction does not
      remove the inode from the i_dirty list and it does not clear the
      NILFS_I_DIRTY flag.  Therefore nilfs_inode_dirty() still returns true,
      which leads to an unnecessary duplicate segment construction in
      nilfs_sync_file().
      
      A call to filemap_write_and_wait_range() is not needed, because NILFS2
      does not rely on the generic writeback mechanisms.  Instead it implements
      its own mechanism to collect all dirty pages and write them into segments.
       It is more efficient to initiate the segment construction directly in
      nilfs_sync_file() without the detour over filemap_write_and_wait_range().
      
      Additionally the lock of i_mutex is not needed, because all code blocks
      that are protected by i_mutex are also protected by a NILFS transaction:
      
        Function                i_mutex     nilfs_transaction
        ------------------------------------------------------
        nilfs_ioctl_setflags:   yes         yes
        nilfs_fiemap:           yes         no
        nilfs_write_begin:      yes         yes
        nilfs_write_end:        yes         yes
        nilfs_lookup:           yes         no
        nilfs_create:           yes         yes
        nilfs_link:             yes         yes
        nilfs_mknod:            yes         yes
        nilfs_symlink:          yes         yes
        nilfs_mkdir:            yes         yes
        nilfs_unlink:           yes         yes
        nilfs_rmdir:            yes         yes
        nilfs_rename:           yes         yes
        nilfs_setattr:          yes         yes
      
      For nilfs_lookup() i_mutex is held for the parent directory, to protect it
      from modification.  The segment construction does not modify directory
      inodes, so no lock is needed.
      
      nilfs_fiemap() reads the block layout on the disk, by using
      nilfs_bmap_lookup_contig(). This is already protected by bmap->b_sem.
      Signed-off-by: NAndreas Rohner <andreas.rohner@gmx.net>
      Signed-off-by: NRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      75dc857c
  10. 14 10月, 2014 2 次提交
    • A
      nilfs2: improve the performance of fdatasync() · b9f66140
      Andreas Rohner 提交于
      Support for fdatasync() has been implemented in NILFS2 for a long time,
      but whenever the corresponding inode is dirty the implementation falls
      back to a full-flegded sync().  Since every write operation has to
      update the modification time of the file, the inode will almost always
      be dirty and fdatasync() will fall back to sync() most of the time.  But
      this fallback is only necessary for a change of the file size and not
      for a change of the various timestamps.
      
      This patch adds a new flag NILFS_I_INODE_SYNC to differentiate between
      those two situations.
      
       * If it is set the file size was changed and a full sync is necessary.
       * If it is not set then only the timestamps were updated and
         fdatasync() can go ahead.
      
      There is already a similar flag I_DIRTY_DATASYNC on the VFS layer with
      the exact same semantics.  Unfortunately it cannot be used directly,
      because NILFS2 doesn't implement write_inode() and doesn't clear the VFS
      flags when inodes are written out.  So the VFS writeback thread can
      clear I_DIRTY_DATASYNC at any time without notifying NILFS2.  So
      I_DIRTY_DATASYNC has to be mapped onto NILFS_I_INODE_SYNC in
      nilfs_update_inode().
      Signed-off-by: NAndreas Rohner <andreas.rohner@gmx.net>
      Signed-off-by: NRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      b9f66140
    • A
      nilfs2: add missing blkdev_issue_flush() to nilfs_sync_fs() · e2c7617a
      Andreas Rohner 提交于
      Under normal circumstances nilfs_sync_fs() writes out the super block,
      which causes a flush of the underlying block device.  But this depends
      on the THE_NILFS_SB_DIRTY flag, which is only set if the pointer to the
      last segment crosses a segment boundary.  So if only a small amount of
      data is written before the call to nilfs_sync_fs(), no flush of the
      block device occurs.
      
      In the above case an additional call to blkdev_issue_flush() is needed.
      To prevent unnecessary overhead, the new flag nilfs->ns_flushed_device
      is introduced, which is cleared whenever new logs are written and set
      whenever the block device is flushed.  For convenience the function
      nilfs_flush_device() is added, which contains the above logic.
      Signed-off-by: NAndreas Rohner <andreas.rohner@gmx.net>
      Signed-off-by: NRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      e2c7617a
  11. 26 9月, 2014 1 次提交
    • A
      nilfs2: fix data loss with mmap() · 56d7acc7
      Andreas Rohner 提交于
      This bug leads to reproducible silent data loss, despite the use of
      msync(), sync() and a clean unmount of the file system.  It is easily
      reproducible with the following script:
      
        ----------------[BEGIN SCRIPT]--------------------
        mkfs.nilfs2 -f /dev/sdb
        mount /dev/sdb /mnt
      
        dd if=/dev/zero bs=1M count=30 of=/mnt/testfile
      
        umount /mnt
        mount /dev/sdb /mnt
        CHECKSUM_BEFORE="$(md5sum /mnt/testfile)"
      
        /root/mmaptest/mmaptest /mnt/testfile 30 10 5
      
        sync
        CHECKSUM_AFTER="$(md5sum /mnt/testfile)"
        umount /mnt
        mount /dev/sdb /mnt
        CHECKSUM_AFTER_REMOUNT="$(md5sum /mnt/testfile)"
        umount /mnt
      
        echo "BEFORE MMAP:\t$CHECKSUM_BEFORE"
        echo "AFTER MMAP:\t$CHECKSUM_AFTER"
        echo "AFTER REMOUNT:\t$CHECKSUM_AFTER_REMOUNT"
        ----------------[END SCRIPT]--------------------
      
      The mmaptest tool looks something like this (very simplified, with
      error checking removed):
      
        ----------------[BEGIN mmaptest]--------------------
        data = mmap(NULL, file_size - file_offset, PROT_READ | PROT_WRITE,
                    MAP_SHARED, fd, file_offset);
      
        for (i = 0; i < write_count; ++i) {
              memcpy(data + i * 4096, buf, sizeof(buf));
              msync(data, file_size - file_offset, MS_SYNC))
        }
        ----------------[END mmaptest]--------------------
      
      The output of the script looks something like this:
      
        BEFORE MMAP:    281ed1d5ae50e8419f9b978aab16de83  /mnt/testfile
        AFTER MMAP:     6604a1c31f10780331a6850371b3a313  /mnt/testfile
        AFTER REMOUNT:  281ed1d5ae50e8419f9b978aab16de83  /mnt/testfile
      
      So it is clear, that the changes done using mmap() do not survive a
      remount.  This can be reproduced a 100% of the time.  The problem was
      introduced in commit 136e8770 ("nilfs2: fix issue of
      nilfs_set_page_dirty() for page at EOF boundary").
      
      If the page was read with mpage_readpage() or mpage_readpages() for
      example, then it has no buffers attached to it.  In that case
      page_has_buffers(page) in nilfs_set_page_dirty() will be false.
      Therefore nilfs_set_file_dirty() is never called and the pages are never
      collected and never written to disk.
      
      This patch fixes the problem by also calling nilfs_set_file_dirty() if the
      page has no buffers attached to it.
      
      [akpm@linux-foundation.org: s/PAGE_SHIFT/PAGE_CACHE_SHIFT/]
      Signed-off-by: NAndreas Rohner <andreas.rohner@gmx.net>
      Tested-by: NAndreas Rohner <andreas.rohner@gmx.net>
      Signed-off-by: NRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      56d7acc7
  12. 09 8月, 2014 9 次提交
    • V
      nilfs2: integrate sysfs support into driver · dd70edbd
      Vyacheslav Dubeyko 提交于
      This patch integrates creation of sysfs groups and
      attributes into NILFS file system driver.
      
      It was found the issue with nilfs_sysfs_{create/delete}_snapshot_group
      functions by Michael L Semon <mlsemon35@gmail.com> in the first
      version of the patch:
      
        BUG: sleeping function called from invalid context at kernel/locking/mutex.c:579
        in_atomic(): 1, irqs_disabled(): 0, pid: 32676, name: umount.nilfs2
        2 locks held by umount.nilfs2/32676:
         #0:  (&type->s_umount_key#21){++++..}, at: [<790c18e2>] deactivate_super+0x37/0x58
         #1:  (&(&nilfs->ns_cptree_lock)->rlock){+.+...}, at: [<791bf659>] nilfs_put_root+0x23/0x5a
        Preemption disabled at:[<791bf659>] nilfs_put_root+0x23/0x5a
      
        CPU: 0 PID: 32676 Comm: umount.nilfs2 Not tainted 3.14.0+ #2
        Hardware name: Dell Computer Corporation Dimension 2350/07W080, BIOS A01 12/17/2002
        Call Trace:
          dump_stack+0x4b/0x75
          __might_sleep+0x111/0x16f
          mutex_lock_nested+0x1e/0x3ad
          kernfs_remove+0x12/0x26
          sysfs_remove_dir+0x3d/0x62
          kobject_del+0x13/0x38
          nilfs_sysfs_delete_snapshot_group+0xb/0xd
          nilfs_put_root+0x2a/0x5a
          nilfs_detach_log_writer+0x1ab/0x2c1
          nilfs_put_super+0x13/0x68
          generic_shutdown_super+0x60/0xd1
          kill_block_super+0x1d/0x60
          deactivate_locked_super+0x22/0x3f
          deactivate_super+0x3e/0x58
          mntput_no_expire+0xe2/0x141
          SyS_oldumount+0x70/0xa5
          syscall_call+0x7/0xb
      
      The reason of the issue was placement of
      nilfs_sysfs_{create/delete}_snapshot_group() call under
      nilfs->ns_cptree_lock protection.  But this protection is unnecessary and
      wrong solution.  The second version of the patch fixes this issue.
      
      [fengguang.wu@intel.com: nilfs_sysfs_create_mounted_snapshots_group can be static]
      Reported-by: NMichael L. Semon <mlsemon35@gmail.com>
      Signed-off-by: NVyacheslav Dubeyko <Vyacheslav.Dubeyko@hgst.com>
      Cc: Vyacheslav Dubeyko <slava@dubeyko.com>
      Cc: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
      Tested-by: NMichael L. Semon <mlsemon35@gmail.com>
      Signed-off-by: NFengguang Wu <fengguang.wu@intel.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      dd70edbd
    • V
      nilfs2: add /sys/fs/nilfs2/<device>/mounted_snapshots/<snapshot> group · a5a7332a
      Vyacheslav Dubeyko 提交于
      This patch adds creation of <snapshot> group for every mounted
      snapshot in /sys/fs/nilfs2/<device>/mounted_snapshots group.
      
      The group contains details about mounted snapshot:
      (1) inodes_count - show number of inodes for snapshot.
      (2) blocks_count - show number of blocks for snapshot.
      Signed-off-by: NVyacheslav Dubeyko <Vyacheslav.Dubeyko@hgst.com>
      Cc: Vyacheslav Dubeyko <slava@dubeyko.com>
      Cc: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
      Cc: Michael L. Semon <mlsemon35@gmail.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      a5a7332a
    • V
      nilfs2: add /sys/fs/nilfs2/<device>/mounted_snapshots group · a2ecb791
      Vyacheslav Dubeyko 提交于
      This patch adds creation of /sys/fs/nilfs2/<device>/mounted_snapshots
      group.
      
      The mounted_snapshots group contains group for every
      mounted snapshot.
      Signed-off-by: NVyacheslav Dubeyko <Vyacheslav.Dubeyko@hgst.com>
      Cc: Vyacheslav Dubeyko <slava@dubeyko.com>
      Cc: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
      Cc: Michael L. Semon <mlsemon35@gmail.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      a2ecb791
    • V
      nilfs2: add /sys/fs/nilfs2/<device>/checkpoints group · 02a0ba1c
      Vyacheslav Dubeyko 提交于
      This patch adds creation of /sys/fs/nilfs2/<device>/checkpoints
      group.
      
      The checkpoints group contains attributes that describe
      details about volume's checkpoints:
      (1) checkpoints_number - show number of checkpoints on volume.
      (2) snapshots_number - show number of snapshots on volume.
      (3) last_seg_checkpoint - show checkpoint number of the latest segment.
      (4) next_checkpoint - show next checkpoint number.
      Signed-off-by: NVyacheslav Dubeyko <Vyacheslav.Dubeyko@hgst.com>
      Cc: Vyacheslav Dubeyko <slava@dubeyko.com>
      Cc: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
      Cc: Michael L. Semon <mlsemon35@gmail.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      02a0ba1c
    • V
      nilfs2: add /sys/fs/nilfs2/<device>/segments group · ef43d5cd
      Vyacheslav Dubeyko 提交于
      This patch adds creation of /sys/fs/nilfs2/<device>/segments
      group.
      
      The segments group contains attributes that describe
      details about volume's segments:
      (1) segments_number - show number of segments on volume.
      (2) blocks_per_segment - show number of blocks in segment.
      (3) clean_segments - show count of clean segments.
      (4) dirty_segments - show count of dirty segments.
      Signed-off-by: NVyacheslav Dubeyko <Vyacheslav.Dubeyko@hgst.com>
      Cc: Vyacheslav Dubeyko <slava@dubeyko.com>
      Cc: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
      Cc: Michael L. Semon <mlsemon35@gmail.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      ef43d5cd
    • V
      nilfs2: add /sys/fs/nilfs2/<device>/segctor group · abc968db
      Vyacheslav Dubeyko 提交于
      This patch adds creation of /sys/fs/nilfs2/<device>/segctor
      group.
      
      The segctor group contains attributes that describe
      segctor thread activity details:
      (1) last_pseg_block - show start block number of the latest segment.
      (2) last_seg_sequence - show sequence value of the latest segment.
      (3) last_seg_checkpoint - show checkpoint number of the latest segment.
      (4) current_seg_sequence - show segment sequence counter.
      (5) current_last_full_seg - show index number of the latest full segment.
      (6) next_full_seg - show index number of the full segment index
      to be used next.
      (7) next_pseg_offset - show offset of next partial segment in
      the current full segment.
      (8) next_checkpoint - show next checkpoint number.
      (9) last_seg_write_time - show write time of the last segment
      in human-readable format.
      (10) last_seg_write_time_secs - show write time of the last segment
      in seconds.
      (11) last_nongc_write_time - show write time of the last segment
      not for cleaner operation in human-readable format.
      (12) last_nongc_write_time_secs - show write time of the last segment
      not for cleaner operation in seconds.
      (13) dirty_data_blocks_count - show number of dirty data blocks.
      Signed-off-by: NVyacheslav Dubeyko <Vyacheslav.Dubeyko@hgst.com>
      Cc: Vyacheslav Dubeyko <slava@dubeyko.com>
      Cc: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
      Cc: Michael L. Semon <mlsemon35@gmail.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      abc968db
    • V
      nilfs2: add /sys/fs/nilfs2/<device>/superblock group · caa05d49
      Vyacheslav Dubeyko 提交于
      This patch adds creation of /sys/fs/nilfs2/<device>/superblock
      group.
      
      The superblock group contains attributes that describe
      superblock's details:
      (1) sb_write_time - show previous write time of super block in
      human-readable format.
      (2) sb_write_time_secs - show previous write time of super block
      in seconds.
      (3) sb_write_count - show write count of super block.
      (4) sb_update_frequency - show/set interval of periodical update
      of superblock (in seconds). You can set preferable frequency of
      superblock update by command:
      
      echo <value> > /sys/fs/nilfs2/<device>/superblock/sb_update_frequency
      Signed-off-by: NVyacheslav Dubeyko <Vyacheslav.Dubeyko@hgst.com>
      Cc: Vyacheslav Dubeyko <slava@dubeyko.com>
      Cc: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
      Cc: Michael L. Semon <mlsemon35@gmail.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      caa05d49
    • V
      nilfs2: add /sys/fs/nilfs2/<device> group · da7141fb
      Vyacheslav Dubeyko 提交于
      This patch adds creation of /sys/fs/nilfs2/<device> group.
      
      The <device> group contains attributes that describe file
      system partition's details:
      (1) revision - show NILFS file system revision.
      (2) blocksize - show volume block size in bytes.
      (3) device_size - show volume size in bytes.
      (4) free_blocks - show count of free blocks on volume.
      (5) uuid - show volume's UUID.
      (6) volume_name - show volume's name.
      Signed-off-by: NVyacheslav Dubeyko <Vyacheslav.Dubeyko@hgst.com>
      Cc: Vyacheslav Dubeyko <slava@dubeyko.com>
      Cc: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
      Cc: Michael L. Semon <mlsemon35@gmail.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      da7141fb
    • V
      nilfs2: add /sys/fs/nilfs2/features group · aebe17f6
      Vyacheslav Dubeyko 提交于
      This patchset implements creation of sysfs groups and attributes with
      the purpose to show NILFS2 volume details, internal state of the driver
      and to manage internal state of NILFS2 driver.
      
      Sysfs is a virtual file system that exports information about devices
      and drivers from the kernel device model to user space, and is also used
      for configuration.  NILFS2 is a complex file system that has segctor
      thread, GC thread, checkpoint/snapshot model and so on.  Sysfs namespace
      provides native and easy way for: (1) getting info and statistics about
      volume state; (2) getting info and configuration of internal subsystems
      (segctor thread); (3) snapshots management.
      
      Suggested patchset provides basis for managing segctor thread behaviour
      and manipulation by snapshots.  Currently, it informs only about segctor
      thread's internal parameters and about mounted snapshots.  But sysfs
      interface can provide easy and simple way for deep management of segctor
      thread and snapshots.
      
      This patchset provides opportunity to manage interval of periodical
      update of superblock (in seconds).  Default value is 10 seconds.  Now a
      user can increase this value by means of
      nilfs2/<device>/superblock/sb_update_frequency attribute in the case of
      necessity.
      
      Also the patchset provides opportunity to get information easily about
      key volumes's parameters (free blocks, superblock write count,
      superblock update frequency, latest segment info, dirty data blocks
      count, count of clean segments, count of dirty segments and so on) in
      real time manner.  Such information can be used in scripts for subtle
      management of filesystem.
      
      Implemented functionality creates such groups:
      (1) /sys/fs/nilfs2 - root group
      (2) /sys/fs/nilfs2/features - group contains attributes that describe NILFS
      file system driver features
      (3) /sys/fs/nilfs2/<device> - group contains attributes that describe file
      system partition's details
      (4) /sys/fs/nilfs2/<device>/superblock - group contains attributes that describe
      superblock's details
      (5) /sys/fs/nilfs2/<device>/segctor - group contains attributes that describe
      segctor thread activity details
      (6) /sys/fs/nilfs2/<device>/segments - group contains attributes that describe
      details about volume's segments
      (7) /sys/fs/nilfs2/<device>/checkpoints - group contains attributes that describe
      details about volume's checkpoints
      (8) /sys/fs/nilfs2/<device>/mounted_snapshots - group contains group for every
      mounted snapshot
      (9) /sys/fs/nilfs2/<device>/mounted_snapshots/<snapshot> - group contains
      details about mounted snapshot
      
      This patch (of 9):
      
      This patch adds code of creation /sys/fs/nilfs2 group and
      /sys/fs/nilfs2/features group.
      
      The features group contains attributes that describe NILFS
      file system driver features:
      (1) revision - show current revision of NILFS file system driver.
      
      There are two formats of timestamp output - seconds and human-readable
      format.  Every showed timestamp has two sysfs files (time-<xxx> and
      time-<xxx>-secs).  One sysfs file (time-<xxx>) shows time in
      human-readable format.  Another sysfs file (time-<xxx>-secs) shows time in
      seconds.
      
      It was reported by Michael Semon that timestamp output in human-readable
      format should be changed from "2014-4-12 14:5:38" to "2014-04-12
      14:05:38".  Second version of the patch fixes this issue.
      Reported-by: NMichael L. Semon <mlsemon35@gmail.com>
      Signed-off-by: NVyacheslav Dubeyko <Vyacheslav.Dubeyko@hgst.com>
      Cc: Vyacheslav Dubeyko <slava@dubeyko.com>
      Cc: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      aebe17f6
  13. 08 8月, 2014 1 次提交
    • J
      dcache: d_obtain_alias callers don't all want DISCONNECTED · 1a0a397e
      J. Bruce Fields 提交于
      There are a few d_obtain_alias callers that are using it to get the
      root of a filesystem which may already have an alias somewhere else.
      
      This is not the same as the filehandle-lookup case, and none of them
      actually need DCACHE_DISCONNECTED set.
      
      It isn't really a serious problem, but it would really be clearer if we
      reserved DCACHE_DISCONNECTED for those cases where it's actually needed.
      
      In the btrfs case this was causing a spurious printk from
      nfsd/nfsfh.c:fh_verify when it found an unexpected DCACHE_DISCONNECTED
      dentry.  Josef worked around this by unsetting DCACHE_DISCONNECTED
      manually in 3a0dfa6a "Btrfs: unset DCACHE_DISCONNECTED when mounting
      default subvol", and this replaces that workaround.
      
      Cc: Josef Bacik <jbacik@fb.com>
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      1a0a397e
  14. 07 5月, 2014 5 次提交
  15. 08 4月, 2014 1 次提交
  16. 04 4月, 2014 2 次提交