Permalink
Commits on Jul 23, 2016
  1. nilfs2-kmod7 v1.1.1 release

    Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
    konis committed Jul 23, 2016
Commits on Jul 19, 2016
  1. fs/nilfs2: fix potential underflow in call to crc32_le

    The value `bytes' comes from the filesystem which is about to be
    mounted.  We cannot trust that the value is always in the range we
    expect it to be.
    
    Check its value before using it to calculate the length for the crc32_le
    call.  It value must be larger (or equal) sumoff + 4.
    
    This fixes a kernel bug when accidentially mounting an image file which
    had the nilfs2 magic value 0x3434 at the right offset 0x406 by chance.
    The bytes 0x01 0x00 were stored at 0x408 and were interpreted as a
    s_bytes value of 1.  This caused an underflow when substracting sumoff +
    4 (20) in the call to crc32_le.
    
      BUG: unable to handle kernel paging request at ffff88021e600000
      IP:  crc32_le+0x36/0x100
      ...
      Call Trace:
        nilfs_valid_sb.part.5+0x52/0x60 [nilfs2]
        nilfs_load_super_block+0x142/0x300 [nilfs2]
        init_nilfs+0x60/0x390 [nilfs2]
        nilfs_mount+0x302/0x520 [nilfs2]
        mount_fs+0x38/0x160
        vfs_kern_mount+0x67/0x110
        do_mount+0x269/0xe00
        SyS_mount+0x9f/0x100
        entry_SYSCALL_64_fastpath+0x16/0x71
    
    Link: http://lkml.kernel.org/r/1466778587-5184-2-git-send-email-konishi.ryusuke@lab.ntt.co.jp
    Signed-off-by: Torsten Hilbrich <torsten.hilbrich@secunet.com>
    Tested-by: Torsten Hilbrich <torsten.hilbrich@secunet.com>
    Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
    Cc: <stable@vger.kernel.org>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
    Torsten Hilbrich committed with konis Jun 24, 2016
Commits on May 24, 2016
  1. nilfs2: remove loops of single statement macros

    This fixes checkpatch.pl warning "WARNING: Single statement macros
    should not use a do {} while (0) loop".
    
    Link: http://lkml.kernel.org/r/1462886671-3521-7-git-send-email-konishi.ryusuke@lab.ntt.co.jp
    Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
    konis committed May 23, 2016
  2. nilfs2: remove unnecessary else after return or break

    This fixes the checkpatch.pl warning that suggests else is not
    generally useful after a break or return.
    
    Link: http://lkml.kernel.org/r/1462886671-3521-6-git-send-email-konishi.ryusuke@lab.ntt.co.jp
    Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
    konis committed May 23, 2016
  3. nilfs2: fix code indent coding style issue

    This fixes checkpatch.pl warning "WARNING: suspect code indent for
    conditional statements".
    
    Link: http://lkml.kernel.org/r/1462886671-3521-4-git-send-email-konishi.ryusuke@lab.ntt.co.jp
    Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
    konis committed May 23, 2016
  4. nilfs2: remove space before semicolon

    This fixes the checkpatch.pl warning "WARNING: space prohibited before
    semicolon" at nilfs_store_magic_and_option().
    
    Link: http://lkml.kernel.org/r/1462886671-3521-3-git-send-email-konishi.ryusuke@lab.ntt.co.jp
    Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
    konis committed May 23, 2016
  5. nilfs2: do not emit extra newline on nilfs_warning() and nilfs_error()

    This updates call sites of nilfs_warning() and nilfs_error() so that they
    don't add a duplicate newline.  These output functions are already
    designed to add a trailing newline to the message.
    
    Link: http://lkml.kernel.org/r/1462886671-3521-2-git-send-email-konishi.ryusuke@lab.ntt.co.jp
    Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
    konis committed May 23, 2016
  6. nilfs2: add missing line spacing

    Clean up checkpatch.pl warnings "WARNING: Missing a blank line after
    declarations" from nilfs2.
    
    Link: http://lkml.kernel.org/r/1461935747-10380-11-git-send-email-konishi.ryusuke@lab.ntt.co.jp
    Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
    konis committed May 23, 2016
  7. nilfs2: clean up old e-mail addresses

    E-mail addresses of osrg.net domain are no longer available.  This
    removes them from authorship notices and prevents reporters from being
    confused.
    
    Link: http://lkml.kernel.org/r/1461935747-10380-5-git-send-email-konishi.ryusuke@lab.ntt.co.jp
    Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
    konis committed May 23, 2016
  8. nilfs2: remove FSF mailing address from GPL notices

    This removes the extra paragraph which mentions FSF address in GPL
    notices from source code of nilfs2 and avoids the checkpatch.pl error
    related to it.
    
    Link: http://lkml.kernel.org/r/1461935747-10380-4-git-send-email-konishi.ryusuke@lab.ntt.co.jp
    Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
    konis committed May 23, 2016
  9. nilfs2: remove space before comma

    Fix checkpatch.pl error "ERROR: space prohibited before that ','
    (ctx:WxW)" at nilfs_sufile_set_suinfo().
    
    This also fixes checkpatch.pl warning "WARNING: Prefer 'unsigned int' to
    bare use of 'unsigned'" at nilfs_sufile_set_suinfo() and
    nilfs_sufile_get_suinfo().
    
    Link: http://lkml.kernel.org/r/1461935747-10380-3-git-send-email-konishi.ryusuke@lab.ntt.co.jp
    Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
    konis committed May 23, 2016
Commits on Nov 8, 2015
  1. nilfs2-kmod7 v1.1 release

    Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
    konis committed Nov 8, 2015
  2. nilfs2: free unused dat file blocks during garbage collection

    As a nilfs2 volume ages, the amount of available disk space decreases
    little by little due to bloat of DAT (disk address translation) metadata
    file.  Even if we delete all files in a file system and free their block
    addresses from the DAT file through a garbage collection, empty DAT blocks
    are not freed.
    
    This fixes the issue by extending the deallocator of block addresses so
    that empty data blocks and empty bitmap blocks of DAT are deleted.
    
    The following comparison shows the effect of this patch.  Each shows disk
    amount information of a nilfs2 volume that we cleaned out by deleting all
    files and running gc after having filled 90% of its capacity.
    
    Before:
    Filesystem     1K-blocks     Used Available Use% Mounted on
    /dev/sda1      500105212  3022844 472072192   1% /test
    
    After:
    Filesystem     1K-blocks     Used Available Use% Mounted on
    /dev/sda1      500105212    16380 475078656   1% /test
    
    Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
    konis committed Nov 7, 2015
  3. nilfs2: add helper functions to delete blocks from dat file

    This adds delete functions for data blocks of metadata files using bitmap
    based allocator.  nilfs_palloc_delete_entry_block() deletes an entry block
    (e.g.  block storing dat entries), and nilfs_palloc_delete_bitmap_block()
    deletes a bitmap block, respectively.
    
    These helpers are intended to be used in the successive change on
    deallocator of block addresses ("nilfs2: free unused dat file blocks
    during garbage collection").
    
    Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
    konis committed Nov 7, 2015
  4. nilfs2: get rid of nilfs_palloc_group_is_in()

    This unfolds nilfs_palloc_group_is_in() helper function into
    nilfs_palloc_freev() function to simplify a range check and an index
    calculation repeatedy performed in a loop of the function.
    
    Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
    konis committed Nov 7, 2015
  5. nilfs2: refactor nilfs_palloc_find_available_slot()

    The current implementation of nilfs_palloc_find_available_slot() function
    is overkill.  The underlying bit search routine is well optimized, so this
    uses it more simply in nilfs_palloc_find_available_slot().
    
    Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
    konis committed Nov 7, 2015
  6. nilfs2: do not call nilfs_mdt_bgl_lock() needlessly

    In the bitmap based allocator implementation, nilfs_mdt_bgl_lock() helper
    is frequently used to get a spinlock protecting a target block group.
    This reduces its usage and simplifies arguments of some related functions
    by directly passing a pointer to the spinlock.
    
    Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
    konis committed Nov 7, 2015
  7. nilfs2: use nilfs_warning() in allocator implementation

    This uses nilfs_warning() to replace "printk(KERN_WARNING ...);" in the
    bitmap based allocator implementation of nilfs2.  The warning messages are
    modified to include the device name and the inode number in each message.
    This makes it clear which metadata file of which device has output
    warnings such as "entry number xxxx already freed".
    
    Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
    konis committed Nov 7, 2015
Commits on Jul 6, 2015
  1. NILFS2: support NFSv2 export

    The "fh_len" passed to ->fh_to_* is not guaranteed to be that same as that
    returned by encode_fh - it may be larger.
    
    With NFSv2, the filehandle is fixed length, so it may appear longer than
    expected and be zero-padded.
    
    So we must test that fh_len is at least some value, not exactly equal to
    it.
    
    Signed-off-by: NeilBrown <neilb@suse.de>
    Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
    neilbrown committed with konis Jun 25, 2015
Commits on Jun 7, 2015
  1. README: include vanilla kernel 3.6+ to supported versions

    Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
    konis committed Jun 7, 2015
  2. Only call file_update_time() in nilfs_page_mkwrite() for kernel 3.7+

    file_update_time() was moved out from __block_page_mkwrite() in kernel
    3.7.  nilfs_page_mkwrite() doesn't need to call it for kernel 3.6 and
    earlier.
    
    Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
    konis committed Jun 7, 2015
  3. Set VM_CAN_NONLINIEAR to vm_flags in kernel 3.6 and earlier

    VM_CAN_NONLINEAR flag was removed in kernel 3.7.  This adds it for
    kernel 3.6 and earlier to support the earlier kernels.
    
    Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
    konis committed Jun 7, 2015
  4. Fix build error due to addition of vm_ops->remap_pages()

    vm_ops->remap_pages() doesn't exist in kernel 3.6 and earlier.  This
    disables the remap_pages() operation to allow build on the earlier
    kernels.
    
    Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
    konis committed Jun 7, 2015
  5. Fix build failure of nilfs_mapping_init() in kernel 3.7

    "assoc_mapping" member of address_space struct was replaced with a new
    member "private_data" in kernel 3.8.  This supports this change to
    allow build on kernel 3.7.
    
    Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
    konis committed Jun 7, 2015
  6. Add FILEID_INVALID macro

    FILEID_INVALID macro doesn't exist in kernel 3.7 and earlier.  This
    adds it to allow build on the earlier kernels.
    
    Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
    konis committed Jun 7, 2015
  7. Add compat function of wait_for_stable_page()

    wait_for_stable_page() function doesn't exist in kernel 3.8 and
    earlier.  This adds its compat function to allow build on the earlier
    kernels.
    
    Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
    konis committed Jun 7, 2015
  8. Add mimic of MODULE_ALIAS_FS macro

    MODULE_ALIAS_FS macro doesn't exist in kernel 3.8 and earlier.  This
    adds a clone of the macro to allow build for the earlier kernels.
    
    Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
    konis committed Jun 7, 2015
  9. Add compat function of file_inode()

    Kernel 3.8 and earlier don't have file_inode() accessor and this
    hinders build of nilfs2-kmod on these kernels.  This adds a compat
    function of file_inode() to support build on them.
    
    Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
    konis committed Jun 7, 2015
Commits on May 7, 2015
  1. nilfs2: fix sanity check of btree level in nilfs_btree_root_broken()

    The range check for b-tree level parameter in nilfs_btree_root_broken()
    is wrong; it accepts the case of "level == NILFS_BTREE_LEVEL_MAX" even
    though the level is limited to values in the range of 0 to
    (NILFS_BTREE_LEVEL_MAX - 1).
    
    Since the level parameter is read from storage device and used to index
    nilfs_btree_path array whose element count is NILFS_BTREE_LEVEL_MAX, it
    can cause memory overrun during btree operations if the boundary value
    is set to the level parameter on device.
    
    This fixes the broken sanity check and adds a comment to clarify that
    the upper bound NILFS_BTREE_LEVEL_MAX is exclusive.
    
    Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
    Cc: <stable@vger.kernel.org>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
    konis committed May 5, 2015
Commits on Apr 19, 2015
  1. nilfs2-kmod7 v1.0 release

    Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
    konis committed Apr 18, 2015
  2. README: update versions of supported mainline kernel

    Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
    konis committed Apr 19, 2015
  3. README: correct spell of CentOS

    Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
    konis committed Apr 19, 2015
Commits on Apr 18, 2015
  1. nilfs2: improve execution time of NILFS_IOCTL_GET_CPINFO ioctl

    The older a filesystem gets, the slower lscp command becomes.  This is
    because nilfs_cpfile_do_get_cpinfo() function meets more hole blocks
    as the start offset of valid checkpoint numbers gets bigger.
    
    This reduces the overhead by skipping hole blocks efficiently with
    nilfs_mdt_find_block() helper.
    
    A measurement result of this patch is as follows:
    
    Before:
    $ time lscp
                     CNO        DATE     TIME  MODE  FLG      BLKCNT       ICNT
                 5769303  2015-02-22 19:31:33   cp    -          108          1
                 5769304  2015-02-22 19:38:54   cp    -          108          1
    
    real    0m0.182s
    user    0m0.003s
    sys     0m0.180s
    
    After:
    $ time lscp
                     CNO        DATE     TIME  MODE  FLG      BLKCNT       ICNT
                 5769303  2015-02-22 19:31:33   cp    -          108          1
                 5769304  2015-02-22 19:38:54   cp    -          108          1
    
    real    0m0.003s
    user    0m0.001s
    sys     0m0.002s
    
    Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
    konis committed Apr 16, 2015
  2. nilfs2: add helper to find existent block on metadata file

    Add a new metadata file function, nilfs_mdt_find_block(), which finds
    an existent block on a metadata file in a given range of blocks.  This
    function skips continuous hole blocks efficiently by using
    nilfs_bmap_seek_key().
    
    Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
    konis committed Apr 16, 2015
  3. nilfs2: add bmap function to seek a valid key

    Add a new bmap function, nilfs_bmap_seek_key(), which seeks a valid
    entry and returns its key starting from a given key.  This function
    can be used to skip hole blocks efficiently.
    
    Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
    Cc: Dan Carpenter <dan.carpenter@oracle.com>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
    konis committed Apr 16, 2015