21 Jul, 2011

1 commit

  • Btrfs needs to be able to control how filemap_write_and_wait_range() is called
    in fsync to make it less of a painful operation, so push down taking i_mutex and
    the calling of filemap_write_and_wait() down into the ->fsync() handlers. Some
    file systems can drop taking the i_mutex altogether it seems, like ext3 and
    ocfs2. For correctness sake I just pushed everything down in all cases to make
    sure that we keep the current behavior the same for everybody, and then each
    individual fs maintainer can make up their mind about what to do from there.
    Thanks,

    Acked-by: Jan Kara
    Signed-off-by: Josef Bacik
    Signed-off-by: Al Viro

    Josef Bacik
     

10 May, 2011

1 commit

  • Previously, nilfs was cloning pages for mmapped region to freeze their
    data and ensure consistency of checksum during writeback cycles. A
    private page allocator was used for this page cloning. But, we no
    longer need to do that since clear_page_dirty_for_io function sets up
    pte so that vm_ops->page_mkwrite function is called right before the
    mmapped pages are modified and nilfs_page_mkwrite function can safely
    wait for the pages to be written back to disk.

    So, this stops making a copy of mmapped pages during writeback, and
    eliminates the private page allocation and deallocation functions from
    nilfs.

    Signed-off-by: Ryusuke Konishi

    Ryusuke Konishi
     

30 Mar, 2011

1 commit

  • From the result of a function test of mmap, mmap write to shared pages
    turned out to be broken for hole blocks. It doesn't write out filled
    blocks and the data will be lost after umount. This is due to a bug
    that the target file is not queued for log writer when filling hole
    blocks.

    Also, nilfs_page_mkwrite function exits normal code path even after
    successfully filled hole blocks due to a change of block_page_mkwrite
    function; just after nilfs was merged into the mainline,
    block_page_mkwrite() started to return VM_FAULT_LOCKED instead of zero
    by the patch "mm: close page_mkwrite races" (commit:
    b827e496c893de0c). The current nilfs_page_mkwrite() is not handling
    this value properly.

    This corrects nilfs_page_mkwrite() and will resolve the data loss
    problem in mmap write.

    [This should be applied to every kernel since 2.6.30 but a fix is
    needed for 2.6.37 and prior kernels]

    Signed-off-by: Ryusuke Konishi
    Tested-by: Ryusuke Konishi
    Cc: stable [2.6.38]

    Ryusuke Konishi
     

09 Mar, 2011

1 commit

  • This directly uses sb->s_fs_info to keep a nilfs filesystem object and
    fully removes the intermediate nilfs_sb_info structure. With this
    change, the hierarchy of on-memory structures of nilfs will be
    simplified as follows:

    Before:
    super_block
    -> nilfs_sb_info
    -> the_nilfs
    -> cptree --+-> nilfs_root (current file system)
    +-> nilfs_root (snapshot A)
    +-> nilfs_root (snapshot B)
    :
    -> nilfs_sc_info (log writer structure)
    After:
    super_block
    -> the_nilfs
    -> cptree --+-> nilfs_root (current file system)
    +-> nilfs_root (snapshot A)
    +-> nilfs_root (snapshot B)
    :
    -> nilfs_sc_info (log writer structure)

    The reason why we didn't design so from the beginning is because the
    initial shape also differed from the above. The early hierachy was
    composed of "per-mount-point" super_block -> nilfs_sb_info pairs and a
    shared nilfs object. On the kernel 2.6.37, it was changed to the
    current shape in order to unify super block instances into one per
    device, and this cleanup became applicable as the result.

    Signed-off-by: Ryusuke Konishi

    Ryusuke Konishi
     

08 Mar, 2011

1 commit

  • The current FS_IOC_GETFLAGS/SETFLAGS/GETVERSION will fail if
    application is 32 bit and kernel is 64 bit.

    This issue is avoidable by adding compat_ioctl method.

    Signed-off-by: Ryusuke Konishi

    Ryusuke Konishi
     

10 Jan, 2011

1 commit

  • This adds fiemap to nilfs. Two new functions, nilfs_fiemap and
    nilfs_find_uncommitted_extent are added.

    nilfs_fiemap() implements the fiemap inode operation, and
    nilfs_find_uncommitted_extent() helps to get a range of data blocks
    whose physical location has not been determined.

    nilfs_fiemap() collects extent information by looping through
    nilfs_bmap_lookup_contig and nilfs_find_uncommitted_extent routines.

    Signed-off-by: Ryusuke Konishi

    Ryusuke Konishi
     

28 May, 2010

1 commit


02 Oct, 2009

1 commit


28 Sep, 2009

1 commit


22 Sep, 2009

1 commit


07 Apr, 2009

5 commits

  • Pekka Enberg suggested converting ->ioctl operations to use
    ->unlocked_ioctl to avoid BKL.

    The conversion was verified to be safe, so I will take it on this
    occasion.

    Cc: Pekka Enberg
    Signed-off-by: Ryusuke Konishi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ryusuke Konishi
     
  • This removes compat code from the nilfs ioctls and applies the same
    function for both .ioctl and .compat_ioctl file operations.

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

    Ryusuke Konishi
     
  • Chris Mason pointed out that there is a missed sync issue in
    nilfs_writepages():

    On Wed, 17 Dec 2008 21:52:55 -0500, Chris Mason wrote:
    > It looks like nilfs_writepage ignores WB_SYNC_NONE, which is used by
    > do_sync_mapping_range().

    where WB_SYNC_NONE in do_sync_mapping_range() was replaced with
    WB_SYNC_ALL by Nick's patch (commit:
    ee53a891f47444c53318b98dac947ede963db400).

    This fixes the problem by letting nilfs_writepages() write out the log of
    file data within the range if sync_mode is WB_SYNC_ALL.

    This involves removal of nilfs_file_aio_write() which was previously
    needed to ensure O_SYNC sync writes.

    Cc: Chris Mason
    Signed-off-by: Ryusuke Konishi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ryusuke Konishi
     
  • This adds the segment constructor (also called log writer).

    The segment constructor collects dirty buffers for every dirty inode,
    makes summaries of the buffers, assigns disk block addresses to the
    buffers, and then submits BIOs for the buffers.

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

    Ryusuke Konishi
     
  • This adds primitives for regular file handling.

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

    Ryusuke Konishi