17 Oct, 2020

1 commit

  • Fixes the following W=1 kernel build warning(s):

    fs/nilfs2/bmap.c:378: warning: Excess function parameter 'bhp' description in 'nilfs_bmap_assign'
    fs/nilfs2/cpfile.c:907: warning: Excess function parameter 'status' description in 'nilfs_cpfile_change_cpmode'
    fs/nilfs2/cpfile.c:946: warning: Excess function parameter 'stat' description in 'nilfs_cpfile_get_stat'
    fs/nilfs2/page.c:76: warning: Excess function parameter 'inode' description in 'nilfs_forget_buffer'
    fs/nilfs2/sufile.c:563: warning: Excess function parameter 'stat' description in 'nilfs_sufile_get_stat'

    Signed-off-by: Wang Hai
    Signed-off-by: Ryusuke Konishi
    Signed-off-by: Andrew Morton
    Link: https://lkml.kernel.org/r/1601386269-2423-1-git-send-email-konishi.ryusuke@gmail.com
    Signed-off-by: Linus Torvalds

    Wang Hai
     

13 Aug, 2020

1 commit

  • Add macros for nilfs_(sb, fmt, ...) and convert the uses of
    'nilfs_msg(sb, KERN_, ...)' to 'nilfs_(sb, ...)' so nilfs2
    uses a logging style more like the typical kernel logging style.

    Miscellanea:

    o Realign arguments for these uses

    Signed-off-by: Joe Perches
    Signed-off-by: Ryusuke Konishi
    Signed-off-by: Andrew Morton
    Link: http://lkml.kernel.org/r/1595860111-3920-4-git-send-email-konishi.ryusuke@gmail.com
    Signed-off-by: Linus Torvalds

    Joe Perches
     

05 Sep, 2018

1 commit

  • Remove the verbose license text from NILFS2 files and replace them with
    SPDX tags. This does not change the license of any of the code.

    Link: http://lkml.kernel.org/r/1535624528-5982-1-git-send-email-konishi.ryusuke@lab.ntt.co.jp
    Signed-off-by: Ryusuke Konishi
    Reviewed-by: Andrew Morton
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ryusuke Konishi
     

07 Feb, 2018

1 commit

  • The superblock and segment timestamps are used only internally in nilfs2
    and can be read out using sysfs.

    Since we are using the old 'get_seconds()' interface and store the data
    as timestamps, the behavior differs slightly between 64-bit and 32-bit
    kernels, the latter will show incorrect timestamps after 2038 in sysfs,
    and presumably fail completely in 2106 as comparisons go wrong.

    This changes nilfs2 to use time64_t with ktime_get_real_seconds() to
    handle timestamps, making the behavior consistent and correct on both
    32-bit and 64-bit machines.

    The on-disk format already uses 64-bit timestamps, so nothing changes
    there.

    Link: http://lkml.kernel.org/r/20180122211050.1286441-1-arnd@arndb.de
    Signed-off-by: Arnd Bergmann
    Acked-by: Ryusuke Konishi
    Cc: Jens Axboe
    Cc: Ingo Molnar
    Cc: Jan Kara
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Arnd Bergmann
     

18 Nov, 2017

1 commit

  • Fix the following checkpatch warning:

    WARNING: Block comments should align the * on each line
    #633: FILE: sufile.c:633:
    +/**
    + * nilfs_sufile_truncate_range - truncate range of segment array

    Link: http://lkml.kernel.org/r/1509367935-3086-4-git-send-email-konishi.ryusuke@lab.ntt.co.jp
    Signed-off-by: Ryusuke Konishi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ryusuke Konishi
     

03 Aug, 2016

3 commits

  • The header file "include/linux/nilfs2_fs.h" is composed of parts for
    ioctl and disk format, and both are intended to be shared with user
    space programs.

    This moves them to the uapi directory "include/uapi/linux" splitting the
    file to "nilfs2_api.h" and "nilfs2_ondisk.h". The following minor
    changes are accompanied by this migration:

    - nilfs_direct_node struct in nilfs2/direct.h is converged to
    nilfs2_ondisk.h because it's an on-disk structure.
    - inline functions nilfs_rec_len_from_disk() and
    nilfs_rec_len_to_disk() are moved to nilfs2/dir.c.

    Link: http://lkml.kernel.org/r/1465825507-3407-4-git-send-email-konishi.ryusuke@lab.ntt.co.jp
    Signed-off-by: Ryusuke Konishi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ryusuke Konishi
     
  • Replace bit shifts by BIT macro for clarity.

    Link: http://lkml.kernel.org/r/1465825507-3407-3-git-send-email-konishi.ryusuke@lab.ntt.co.jp
    Signed-off-by: Ryusuke Konishi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ryusuke Konishi
     
  • Replace most use of printk() in nilfs2 implementation with nilfs_msg(),
    and reduce the following checkpatch.pl warning:

    "WARNING: Prefer [subsystem eg: netdev]_crit([subsystem]dev, ...
    then dev_crit(dev, ... then pr_crit(... to printk(KERN_CRIT ..."

    This patch also fixes a minor checkpatch warning "WARNING: quoted string
    split across lines" that often accompanies the prior warning, and amends
    message format as needed.

    Link: http://lkml.kernel.org/r/1464875891-5443-5-git-send-email-konishi.ryusuke@lab.ntt.co.jp
    Signed-off-by: Ryusuke Konishi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ryusuke Konishi
     

24 May, 2016

4 commits

  • 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
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ryusuke Konishi
     
  • 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
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ryusuke Konishi
     
  • 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
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ryusuke Konishi
     
  • 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
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ryusuke Konishi
     

07 Nov, 2015

2 commits

  • Fix the following build warnings:

    $ make W=1
    [...]
    CC [M] fs/nilfs2/btree.o
    fs/nilfs2/btree.c: In function 'nilfs_btree_split':
    fs/nilfs2/btree.c:923:8: warning: variable 'newptr' set but not used [-Wunused-but-set-variable]
    __u64 newptr;
    ^
    fs/nilfs2/btree.c:922:8: warning: variable 'newkey' set but not used [-Wunused-but-set-variable]
    __u64 newkey;
    ^
    CC [M] fs/nilfs2/dat.o
    fs/nilfs2/dat.c: In function 'nilfs_dat_prepare_end':
    fs/nilfs2/dat.c:158:8: warning: variable 'start' set but not used [-Wunused-but-set-variable]
    __u64 start;
    ^
    CC [M] fs/nilfs2/segment.o
    fs/nilfs2/segment.c: In function 'nilfs_segctor_do_immediate_flush':
    fs/nilfs2/segment.c:2433:6: warning: variable 'err' set but not used [-Wunused-but-set-variable]
    int err;
    ^
    CC [M] fs/nilfs2/sufile.o
    fs/nilfs2/sufile.c: In function 'nilfs_sufile_alloc':
    fs/nilfs2/sufile.c:320:27: warning: variable 'ncleansegs' set but not used [-Wunused-but-set-variable]
    unsigned long nsegments, ncleansegs, nsus, cnt;
    ^
    CC [M] fs/nilfs2/alloc.o
    fs/nilfs2/alloc.c: In function 'nilfs_palloc_prepare_alloc_entry':
    fs/nilfs2/alloc.c:478:38: warning: variable 'groups_per_desc_block' set but not used [-Wunused-but-set-variable]
    unsigned long n, entries_per_group, groups_per_desc_block;
    ^

    Signed-off-by: Ryusuke Konishi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ryusuke Konishi
     
  • This patch adds tracepoints which would be useful for analyzing segment
    usage from a perspective of high level sufile manipulation (check, alloc,
    free). sufile is an important in-place updated metadata file, so
    analyzing the behavior would be useful for performance turning.

    example of usage (a case of allocation):

    $ sudo bin/tpoint nilfs2:nilfs2_segment_usage_allocated
    Tracing nilfs2:nilfs2_segment_usage_allocated. Ctrl-C to end.
    segctord-17800 [002] ...1 10671.867294: nilfs2_segment_usage_allocated: sufile = ffff880054f908a8 segnum = 2
    segctord-17800 [002] ...1 10675.073477: nilfs2_segment_usage_allocated: sufile = ffff880054f908a8 segnum = 3

    Signed-off-by: Hitoshi Mitake
    Signed-off-by: Ryusuke Konishi
    Cc: Steven Rostedt
    Cc: Benixon Dhas
    Cc: TK Kato
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Hitoshi Mitake
     

04 Apr, 2014

3 commits

  • Add code to check sizes of on-disk data of metadata files such as inode
    size, segment usage size, DAT entry size, and checkpoint size. Although
    these sizes are read from disk, the current implementation doesn't check
    them.

    If these sizes are not sane on disk, it can cause out-of-range access to
    metadata or memory access overrun on metadata block buffers due to
    overflow in sundry calculations.

    Both lower limit and upper limit of metadata sizes are verified to
    prevent these issues.

    Signed-off-by: Ryusuke Konishi
    Cc: Andreas Rohner
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ryusuke Konishi
     
  • Add nilfs_sufile_trim_fs(), which takes an fstrim_range structure and
    calls blkdev_issue_discard for every clean segment in the specified
    range. The range is truncated to file system block boundaries.

    Signed-off-by: Andreas Rohner
    Signed-off-by: Ryusuke Konishi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andreas Rohner
     
  • Introduce nilfs_sufile_set_suinfo(), which expects an array of
    nilfs_suinfo_update structures and updates the segment usage information
    accordingly.

    This is basically a helper function for the newly introduced
    NILFS_IOCTL_SET_SUINFO ioctl.

    [konishi.ryusuke@lab.ntt.co.jp: use put_bh() instead of brelse() because we know bh != NULL]
    Signed-off-by: Andreas Rohner
    Signed-off-by: Ryusuke Konishi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andreas Rohner
     

31 Jul, 2012

1 commit


20 Mar, 2012

1 commit


10 May, 2011

5 commits


23 Oct, 2010

2 commits


14 Mar, 2010

1 commit


20 Nov, 2009

8 commits


10 Jun, 2009

2 commits

  • Nilfs has some ioctl commands to read out metadata from meta data
    files:

    - NILFS_IOCTL_GET_CPINFO for checkpoint file,
    - NILFS_IOCTL_GET_SUINFO for segment usage file, and
    - NILFS_IOCTL_GET_VINFO for Disk Address Transalation (DAT) file,
    respectively.

    Every routine on these metadata files is implemented so that it allows
    future expansion of on-disk format. But, the above ioctl commands do
    not support expansion even though nilfs_argv structure can handle
    arbitrary size for data exchanged via ioctl.

    This allows future expansion of the following structures which give
    basic format of the "get information" ioctls:

    - struct nilfs_cpinfo
    - struct nilfs_suinfo
    - struct nilfs_vinfo

    So, this introduces forward compatility of such ioctl commands.

    In this patch, a sanity check in nilfs_ioctl_get_info() function is
    changed to accept larger data structure [1], and metadata read
    routines are rewritten so that they become compatible for larger
    structures; the routines will just ignore the remaining fields which
    the current version of nilfs doesn't know.

    [1] The ioctl function already has another upper limit (PAGE_SIZE
    against a structure, which appears in nilfs_ioctl_wrap_copy
    function), and this will not cause security problem.

    Signed-off-by: Ryusuke Konishi

    Ryusuke Konishi
     
  • This is a preparation for the later cleanup patch ("nilfs2: remove
    list of freeing segments").

    This adds nilfs_sufile_updatev() to sufile, which can modify multiple
    segment usages at a time.

    Signed-off-by: Ryusuke Konishi

    Ryusuke Konishi
     

13 Apr, 2009

3 commits

  • On-disk counters ndirtysegs and ncleansegs of sufile, can go wrong
    after roll-forward recovery because
    nilfs_prepare_segment_for_recovery() function marks segments dirty
    without adjusting value of these counters.

    This fixes the problem by adding a function to sufile which does the
    operation adjusting the counters, and by letting the recovery function
    use it.

    Signed-off-by: Ryusuke Konishi

    Ryusuke Konishi
     
  • This will simplify sufile.c by sharing common code which repeatedly
    appears in routines updating a segment usage entry; a wrapper function
    nilfs_sufile_update() is introduced for the purpose, and counter
    modifications are integrated to a new function
    nilfs_sufile_mod_counter().

    This is a preparation for the successive bugfix patch ("nilfs2: fix
    possible mismatch of sufile counters on recovery").

    Signed-off-by: Ryusuke Konishi

    Ryusuke Konishi
     
  • The nilfs_sufile_set_error() function wrongly adjusts the number of
    dirty segments instead of the number of clean segments. In addition,
    the function calls brelse() twice for the same buffer head.

    This fixes these bugs.

    Signed-off-by: Ryusuke Konishi

    Ryusuke Konishi