10 May, 2011

1 commit


09 Mar, 2011

4 commits


08 Mar, 2011

1 commit

  • At present, the same warning message can be output twice when nilfs
    detected a problem on super blocks:

    NILFS warning: broken superblock. using spare superblock.
    NILFS warning: broken superblock. using spare superblock.
    ...

    This is because these super blocks are reloaded with the block size
    written in a super block if it differs from the first block size, but
    this repetition looks somewhat confusing. So, we hint at what is
    going on by appending block size information to those messages.

    Reported-by: Wakko Warner
    Signed-off-by: Ryusuke Konishi

    Ryusuke Konishi
     

10 Jan, 2011

2 commits


23 Oct, 2010

12 commits

  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ryusuke/nilfs2: (36 commits)
    nilfs2: eliminate sparse warning - "context imbalance"
    nilfs2: eliminate sparse warnings - "symbol not declared"
    nilfs2: get rid of bdi from nilfs object
    nilfs2: change license of exported header file
    nilfs2: add bdev freeze/thaw support
    nilfs2: accept 64-bit checkpoint numbers in cp mount option
    nilfs2: remove own inode allocator and destructor for metadata files
    nilfs2: get rid of back pointer to writable sb instance
    nilfs2: get rid of mi_nilfs back pointer to nilfs object
    nilfs2: see state of root dentry for mount check of snapshots
    nilfs2: use iget for all metadata files
    nilfs2: get rid of GCDAT inode
    nilfs2: add routines to redirect access to buffers of DAT file
    nilfs2: add routines to roll back state of DAT file
    nilfs2: add routines to save and restore bmap state
    nilfs2: do not allocate nilfs_mdt_info structure to gc-inodes
    nilfs2: allow nilfs_clear_inode to clear metadata file inodes
    nilfs2: get rid of snapshot mount flag
    nilfs2: simplify life cycle management of nilfs object
    nilfs2: do not allocate multiple super block instances for a device
    ...

    Linus Torvalds
     
  • Nilfs now can use sb->s_bdi to get backing_dev_info, so we use it
    instead of ns_bdi on the nilfs object and remove ns_bdi.

    Signed-off-by: Ryusuke Konishi

    Ryusuke Konishi
     
  • Nilfs object holds a back pointer to a writable super block instance
    in nilfs->ns_writer, and this became eliminable since sb is now made
    per device and all inodes have a valid pointer to it.

    This deletes the ns_writer pointer and a reader/writer semaphore
    protecting it.

    Signed-off-by: Ryusuke Konishi

    Ryusuke Konishi
     
  • After applied the patch that unified sb instances, root dentry of
    snapshots can be left in dcache even after their trees are unmounted.

    The orphan root dentry/inode keeps a root object, and this causes
    false positive of nilfs_checkpoint_is_mounted function.

    This resolves the issue by having nilfs_checkpoint_is_mounted test
    whether the root dentry is busy or not.

    Signed-off-by: Ryusuke Konishi

    Ryusuke Konishi
     
  • This makes use of iget5_locked to allocate or get inode for metadata
    files to stop using own inode allocator.

    Signed-off-by: Ryusuke Konishi

    Ryusuke Konishi
     
  • This applies prepared rollback function and redirect function of
    metadata file to DAT file, and eliminates GCDAT inode.

    Signed-off-by: Ryusuke Konishi

    Ryusuke Konishi
     
  • This stops pre-allocating nilfs object in nilfs_get_sb routine, and
    stops managing its life cycle by reference counting.

    nilfs_find_or_create_nilfs() function, nilfs->ns_mount_mutex,
    nilfs_objects list, and the reference counter will be removed through
    the simplification.

    Signed-off-by: Ryusuke Konishi

    Ryusuke Konishi
     
  • This stops allocating multiple super block instances for a device.

    All snapshots and a current mode mount (i.e. latest tree) will be
    controlled with nilfs_root objects that are kept within an sb
    instance.

    nilfs_get_sb() is rewritten so that it always has a root object for
    the latest tree and snapshots make additional root objects.

    The root dentry of the latest tree is binded to sb->s_root even if it
    isn't attached on a directory. Root dentries of snapshots or the
    latest tree are binded to mnt->mnt_root on which they are mounted.

    With this patch, nilfs_find_sbinfo() function, nilfs->ns_supers list,
    and nilfs->ns_current back pointer, are deleted. In addition,
    init_nilfs() and load_nilfs() are simplified since they will be called
    once for a device, not repeatedly called for mount points.

    Signed-off-by: Ryusuke Konishi

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

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

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

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

    Ryusuke Konishi
     

19 Oct, 2010

1 commit


17 Sep, 2010

1 commit

  • All the blkdev_issue_* helpers can only sanely be used for synchronous
    caller. To issue cache flushes or barriers asynchronously the caller needs
    to set up a bio by itself with a completion callback to move the asynchronous
    state machine ahead. So drop the BLKDEV_IFL_WAIT flag that is always
    specified when calling blkdev_issue_* and also remove the now unused flags
    argument to blkdev_issue_flush and blkdev_issue_zeroout. For
    blkdev_issue_discard we need to keep it for the secure discard flag, which
    gains a more descriptive name and loses the bitops vs flag confusion.

    Signed-off-by: Christoph Hellwig
    Signed-off-by: Jens Axboe

    Christoph Hellwig
     

10 Sep, 2010

1 commit

  • Switch to the WRITE_FLUSH_FUA flag for log writes, remove the EOPNOTSUPP
    detection for barriers and stop setting the barrier flag for discards.

    tj: nilfs is now fixed to wait for discard completion. Updated this
    patch accordingly and dropped warning about it.

    Signed-off-by: Christoph Hellwig
    Acked-by: Ryusuke Konishi
    Signed-off-by: Tejun Heo
    Signed-off-by: Jens Axboe

    Christoph Hellwig
     

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