30 Aug, 2010

1 commit


18 Aug, 2010

1 commit

  • nilfs_discard_segment() doesn't wait for completion of discard
    requests. This specifies BLKDEV_IFL_WAIT flag when calling
    blkdev_issue_discard() in order to fix the sync failure.

    Reported-by: Christoph Hellwig
    Signed-off-by: Ryusuke Konishi
    Cc: Christoph Hellwig

    Ryusuke Konishi
     

16 Aug, 2010

1 commit

  • After applying commit b2ac86e1, the following message got appeared
    after unclean shutdown:

    > NILFS warning: broken superblock. using spare superblock.

    This turns out to be a false message due to the change which updates
    two super blocks alternately. The secondary super block now can be
    selected if it's newer than the primary one.

    This kills the false warning by suppressing it if another super block
    is not actually broken.

    Signed-off-by: Ryusuke Konishi

    Ryusuke Konishi
     

25 Jul, 2010

1 commit

  • 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: Ryusuke Konishi

    Ryusuke Konishi
     

23 Jul, 2010

10 commits

  • This forces nilfs to check compatibility of feature flags so as to
    reject a filesystem with unknown features when it mounts or remounts
    the filesystem.

    Signed-off-by: Ryusuke Konishi

    Ryusuke Konishi
     
  • Super blocks of nilfs are periodically overwritten in order to record
    the recent log position. This shortens recovery time after unclean
    unmount, but the current implementation performs the update even for a
    few blocks of change. If the filesystem gets small changes slowly and
    continually, super blocks may be updated excessively.

    This moderates the issue by skipping update of log cursor if it does
    not cross a segment boundary.

    Signed-off-by: Ryusuke Konishi

    Ryusuke Konishi
     
  • Although nilfs redundantly uses two super blocks and each may point to
    different position on log, the current version of nilfs does not try
    fallback to the spare super block when it doesn't find any valid log
    at the position that the primary super block points to.

    This has been a cause of mount failures due to write order reversals
    on barrier less block devices.

    This inserts fallback code in error path of nilfs_search_super_root
    routine to resolve the mount failure problem.

    Signed-off-by: Ryusuke Konishi

    Ryusuke Konishi
     
  • This separates a setup routine of log cursor from init_nilfs(). The
    routine, nilfs_store_log_cursor, reads the last position of the log
    containing a super root, and initializes relevant state on the nilfs
    object.

    Signed-off-by: Ryusuke Konishi

    Ryusuke Konishi
     
  • This will sync super blocks in turns instead of syncing duplicate
    super blocks at the time. This will help searching valid super root
    when super block is written into disk before log is written, which is
    happen when barrier-less block devices are unmounted uncleanly. In
    the situation, old super block likely points to valid log.

    This patch introduces ns_sbwcount member to the nilfs object and adds
    nilfs_sb_will_flip() function; ns_sbwcount counts how many times super
    blocks write back to the disk. And, nilfs_sb_will_flip() decides
    whether flipping required or not based on the count of ns_sbwcount to
    sync super blocks asymmetrically.

    The following functions are also changed:

    - nilfs_prepare_super(): flips super blocks according to the
    argument. The argument is calculated by nilfs_sb_will_flip()
    function.

    - nilfs_cleanup_super(): sets "clean" flag to both super blocks if
    they point to the same checkpoint.

    To update both of super block information, caller of
    nilfs_commit_super must set the information on both super blocks.

    Signed-off-by: Jiro SEKIBA
    Signed-off-by: Ryusuke Konishi

    Jiro SEKIBA
     
  • This function write out filesystem state to super blocks in order to
    share the same cleanup work. This is a preparation for making super
    block writeback alternately.

    Cc: Jiro SEKIBA
    Signed-off-by: Ryusuke Konishi

    Ryusuke Konishi
     
  • This counter is unused.

    Signed-off-by: Ryusuke Konishi

    Ryusuke Konishi
     
  • The function name of nilfs_recover_logical_segments makes no sense.
    This changes the name into nilfs_salvage_orphan_logs to clarify the
    role of the function.

    Signed-off-by: Ryusuke Konishi

    Ryusuke Konishi
     
  • Most functions in recovery code take an argument of a super block
    instance or a nilfs_sb_info struct for convenience sake.

    This replaces them aggressively with a nilfs object by applying
    __bread and __breadahead against routines using sb_bread and
    sb_breadahead.

    Signed-off-by: Ryusuke Konishi

    Ryusuke Konishi
     
  • This stores blocksize in nilfs objects for the successive refactoring
    of recovery logic.

    Signed-off-by: Ryusuke Konishi

    Ryusuke Konishi
     

22 May, 2010

1 commit


10 May, 2010

1 commit

  • 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: Ryusuke Konishi

    Ryusuke Konishi
     

29 Apr, 2010

1 commit

  • After merging the block tree, today's linux-next build (powerpc ppc64_defconfig)
    failed like this:

    fs/nilfs2/the_nilfs.c: In function 'nilfs_discard_segments':
    fs/nilfs2/the_nilfs.c:673: error: 'DISCARD_FL_BARRIER' undeclared (first use in this function)

    Caused by commit fbd9b09a177a481eda256447c881f014f29034fe ("blkdev:
    generalize flags for blkdev_issue_fn functions") interacting with commit
    e902ec9906e844f4613fa6190c6fa65f162dc86e ("nilfs2: issue discard request
    after cleaning segments") (which netered Linus' tree on about March 4 -
    before v2.6.34-rc1).

    Signed-off-by: Stephen Rothwell
    Signed-off-by: Jens Axboe

    Stephen Rothwell
     

14 Mar, 2010

1 commit

  • This kills the following checkpatch warnings:

    WARNING: unnecessary whitespace before a quoted newline
    #869: FILE: super.c:869:
    + "remount to a different snapshot. \n",

    WARNING: unnecessary whitespace before a quoted newline
    #389: FILE: the_nilfs.c:389:
    + printk(KERN_ERR "NILFS: too short segment. \n");

    Signed-off-by: Ryusuke Konishi

    Ryusuke Konishi
     

13 Feb, 2010

1 commit


20 Nov, 2009

8 commits


16 Sep, 2009

1 commit

  • It has been unused since it was introduced in:

    commit 520808bf20e90fdbdb320264ba7dd5cf9d47dcac
    Author: Andrew Morton
    Date: Fri May 21 00:46:17 2004 -0700

    [PATCH] block device layer: separate backing_dev_info infrastructure

    So lets just kill it.

    Acked-by: Jan Kara
    Signed-off-by: Jens Axboe

    Jens Axboe
     

14 Sep, 2009

2 commits

  • 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: Ryusuke Konishi

    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
    201913ed746c7724a40d33ee5a0b6a1fd2ef3193. 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:
    [] 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:
    [] ? printk+0xf/0x18
    [] print_unlock_inbalance_bug+0xcc/0xd7
    [] ? prop_put_global+0x3/0x35
    [] lock_release+0xed/0x1dc
    [] ? mutex_unlock+0x8/0xa
    [] __mutex_unlock_slowpath+0xaf/0x119
    [] mutex_unlock+0x8/0xa
    [] nilfs_mdt_write_page+0xd8/0xe1 [nilfs2]
    [] shrink_page_list+0x379/0x68d
    [] ? isolate_pages_global+0xb4/0x18c
    [] shrink_list+0x26b/0x54b
    [] shrink_zone+0x20c/0x2a2
    [] kswapd+0x407/0x591
    [] ? isolate_pages_global+0x0/0x18c
    [] ? autoremove_wake_function+0x0/0x33
    [] ? kswapd+0x0/0x591
    [] kthread+0x69/0x6e
    [] ? kthread+0x0/0x6e
    [] kernel_thread_helper+0x7/0x1a

    This patch uses a reader/writer semaphore instead of the own lock and
    kills this warning.

    Signed-off-by: Ryusuke Konishi

    Ryusuke Konishi
     

16 Jun, 2009

1 commit

  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ryusuke/nilfs2: (22 commits)
    nilfs2: support contiguous lookup of blocks
    nilfs2: add sync_page method to page caches of meta data
    nilfs2: use device's backing_dev_info for btree node caches
    nilfs2: return EBUSY against delete request on snapshot
    nilfs2: modify list of unsupported features in caveats
    nilfs2: enable sync_page method
    nilfs2: set bio unplug flag for the last bio in segment
    nilfs2: allow future expansion of metadata read out via get info ioctl
    NILFS2: Pagecache usage optimization on NILFS2
    nilfs2: remove nilfs_btree_operations from btree mapping
    nilfs2: remove nilfs_direct_operations from direct mapping
    nilfs2: remove bmap pointer operations
    nilfs2: remove useless b_low and b_high fields from nilfs_bmap struct
    nilfs2: remove pointless NULL check of bpop_commit_alloc_ptr function
    nilfs2: move get block functions in bmap.c into btree codes
    nilfs2: remove nilfs_bmap_delete_block
    nilfs2: remove nilfs_bmap_put_block
    nilfs2: remove header file for segment list operations
    nilfs2: eliminate removal list of segments
    nilfs2: add sufile function that can modify multiple segment usages
    ...

    Linus Torvalds
     

12 Jun, 2009

4 commits

  • 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: Ryusuke Konishi
    Cc: Christoph Hellwig
    Signed-off-by: Al Viro

    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: Ryusuke Konishi
    Signed-off-by: Al Viro

    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: Ryusuke Konishi
    Cc: Al Viro
    Signed-off-by: Al Viro

    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: Ryusuke Konishi
    Cc: Al Viro
    Signed-off-by: Al Viro

    Ryusuke Konishi
     

10 Jun, 2009

1 commit

  • This will eliminate obsolete list operations of nilfs_segment_entry
    structure which has been used to handle mutiple segment numbers.

    The patch ("nilfs2: remove list of freeing segments") removed use of
    the structure from the segment constructor code, and this patch
    simplifies the remaining code by integrating it into recovery.c.

    Signed-off-by: Ryusuke Konishi

    Ryusuke Konishi
     

23 May, 2009

1 commit

  • Until now we have had a 1:1 mapping between storage device physical
    block size and the logical block sized used when addressing the device.
    With SATA 4KB drives coming out that will no longer be the case. The
    sector size will be 4KB but the logical block size will remain
    512-bytes. Hence we need to distinguish between the physical block size
    and the logical ditto.

    This patch renames hardsect_size to logical_block_size.

    Signed-off-by: Martin K. Petersen
    Signed-off-by: Jens Axboe

    Martin K. Petersen
     

13 Apr, 2009

1 commit

  • 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: [] nilfs_sufile_get_stat+0x1e/0x105 [nilfs2]
    but task is already holding lock:
    (&mi->mi_sem){----}, at: [] nilfs_count_free_blocks+0x48/0x84 [nilfs2]

    Signed-off-by: Ryusuke Konishi

    Ryusuke Konishi
     

07 Apr, 2009

2 commits

  • The former versions didn't have extra super blocks. This improves the
    weak point by introducing another super block at unused region in tail of
    the partition.

    This doesn't break disk format compatibility; older versions just ingore
    the secondary super block, and new versions just recover it if it doesn't
    exist. The partition created by an old mkfs may not have unused region,
    but in that case, the secondary super block will not be added.

    This doesn't make more redundant copies of the super block; it is a future
    work.

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

    Ryusuke Konishi
     
  • This adds a new argument to the nilfs_sustat structure.

    The extended field allows to delete volatile active state of segments,
    which was needed to protect freshly-created segments from garbage
    collection but has confused code dealing with segments. This
    extension alleviates the mess and gives room for further
    simplifications.

    The volatile active flag is not persistent, so it's eliminable on this
    occasion without affecting compatibility other than the ioctl change.

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

    Ryusuke Konishi