11 Nov, 2011

1 commit

  • I-node cache forgets to reserve the space when writing out it. And when
    we do some stress test, such as synctest, it will trigger WARN_ON() in
    use_block_rsv().

    WARNING: at fs/btrfs/extent-tree.c:5718 btrfs_alloc_free_block+0xbf/0x281 [btrfs]()
    ...
    Call Trace:
    [] warn_slowpath_common+0x80/0x98
    [] warn_slowpath_null+0x15/0x17
    [] btrfs_alloc_free_block+0xbf/0x281 [btrfs]
    [] ? __set_page_dirty_nobuffers+0xfe/0x108
    [] __btrfs_cow_block+0x118/0x3b5 [btrfs]
    [] btrfs_cow_block+0x103/0x14e [btrfs]
    [] btrfs_search_slot+0x249/0x6a4 [btrfs]
    [] btrfs_lookup_inode+0x2a/0x8a [btrfs]
    [] btrfs_update_inode+0xaa/0x141 [btrfs]
    [] btrfs_save_ino_cache+0xea/0x202 [btrfs]
    [] ? btrfs_update_reloc_root+0x17e/0x197 [btrfs]
    [] commit_fs_roots+0xaa/0x158 [btrfs]
    [] btrfs_commit_transaction+0x405/0x731 [btrfs]
    [] ? wake_up_bit+0x25/0x25
    [] ? btrfs_log_dentry_safe+0x43/0x51 [btrfs]
    [] btrfs_sync_file+0x16a/0x198 [btrfs]
    [] ? mntput+0x21/0x23
    [] vfs_fsync_range+0x18/0x21
    [] vfs_fsync+0x17/0x19
    [] do_fsync+0x29/0x3e
    [] sys_fsync+0xb/0xf
    [] system_call_fastpath+0x16/0x1b

    Sometimes it causes BUG_ON() in the reservation code of the delayed inode
    is triggered.

    So we must reserve enough space for inode cache.

    Note: If we can not reserve the enough space for inode cache, we will
    give up writing out it.

    Signed-off-by: Miao Xie
    Signed-off-by: Chris Mason

    Miao Xie
     

20 Oct, 2011

1 commit

  • Since free space inodes now use normal checksumming we need to make sure to
    account for their metadata use. So reserve metadata space, and then if we fail
    to write out the metadata we can just release it, otherwise it will be freed up
    when the io completes. Thanks,

    Signed-off-by: Josef Bacik

    Josef Bacik
     

04 Jun, 2011

4 commits

  • wrap checking of filesystem 'closing' flag and fix a few missing memory
    barriers.

    Signed-off-by: David Sterba

    David Sterba
     
  • This makes the inode map cache default to off until we
    fix the overflow problem when the free space crcs don't fit
    inside a single page.

    Signed-off-by: Chris Mason

    Chris Mason
     
  • With xfstest 254 I can panic the box every time with the inode number caching
    stuff on. This is because we clean the inodes out when we delete the subvolume,
    but then we write out the inode cache which adds an inode to the subvolume inode
    tree, and then when it gets evicted again the root gets added back on the dead
    roots list and is deleted again, so we have a double free. To stop this from
    happening just return 0 if refs is 0 (and we're not the tree root since tree
    root always has refs of 0). With this fix 254 no longer panics. Thanks,

    Signed-off-by: Josef Bacik
    Tested-by: David Sterba
    Signed-off-by: Chris Mason

    Josef Bacik
     
  • This adds extra checks to make sure the inode map we are caching really
    belongs to a FS root instead of a special relocation tree. It
    prevents crashes during balancing operations.

    Signed-off-by: Liu Bo
    Signed-off-by: Chris Mason

    liubo
     

27 May, 2011

1 commit

  • For a filesystem that has lots of files in it, the first time we mount
    it with free ino caching support, it can take quite a long time to
    setup the caching before we can create new files.

    Here we fill the cache with [highest_ino, BTRFS_LAST_FREE_OBJECTID]
    before we start the caching thread to search through the extent tree.

    Signed-off-by: Li Zefan
    Signed-off-by: Chris Mason

    Li Zefan
     

23 May, 2011

1 commit


25 Apr, 2011

2 commits

  • This is similar to block group caching.

    We dedicate a special inode in fs tree to save free ino cache.

    At the very first time we create/delete a file after mount, the free ino
    cache will be loaded from disk into memory. When the fs tree is commited,
    the cache will be written back to disk.

    To keep compatibility, we check the root generation against the generation
    of the special inode when loading the cache, so the loading will fail
    if the btrfs filesystem was mounted in an older kernel before.

    Signed-off-by: Li Zefan

    Li Zefan
     
  • Currently btrfs stores the highest objectid of the fs tree, and it always
    returns (highest+1) inode number when we create a file, so inode numbers
    won't be reclaimed when we delete files, so we'll run out of inode numbers
    as we keep create/delete files in 32bits machines.

    This fixes it, and it works similarly to how we cache free space in block
    cgroups.

    We start a kernel thread to read the file tree. By scanning inode items,
    we know which chunks of inode numbers are free, and we cache them in
    an rb-tree.

    Because we are searching the commit root, we have to carefully handle the
    cross-transaction case.

    The rb-tree is a hybrid extent+bitmap tree, so if we have too many small
    chunks of inode numbers, we'll use bitmaps. Initially we allow 16K ram
    of extents, and a bitmap will be used if we exceed this threshold. The
    extents threshold is adjusted in runtime.

    Signed-off-by: Li Zefan

    Li Zefan
     

28 Mar, 2011

1 commit


22 Sep, 2009

1 commit

  • The new back reference format does not allow reusing objectid of
    deleted snapshot/subvol. So we use ++highest_objectid to allocate
    objectid for new snapshot/subvol.

    Now we use ++highest_objectid to allocate objectid for both new inode
    and new snapshot/subvolume, so this patch removes 'find hole' code in
    btrfs_find_free_objectid.

    Signed-off-by: Yan Zheng
    Signed-off-by: Chris Mason

    Yan, Zheng
     

27 Apr, 2009

1 commit

  • A small warning popped up on ia64 because inode-map.c was comparing a
    u64 object id with the ULL FIRST_FREE_OBJECTID. My first thought was
    that all the OBJECTID constants should contain the u64 cast because
    btrfs code deals entirely in u64s. But then I saw how large that was,
    and figured I'd just fix the max() call.

    Signed-off-by: Joel Becker
    Signed-off-by: Chris Mason

    Joel Becker
     

13 Feb, 2009

1 commit

  • btrfs_init_path was initially used when the path objects were on the
    stack. Now all the work is done by btrfs_alloc_path and btrfs_init_path
    isn't required.

    This patch removes it, and just uses kmem_cache_zalloc to zero out the object.

    Signed-off-by: Chris Mason

    Jeff Mahoney
     

06 Jan, 2009

1 commit


26 Sep, 2008

1 commit

  • * Add an EXTENT_BOUNDARY state bit to keep the writepage code
    from merging data extents that are in the process of being
    relocated. This allows us to do accounting for them properly.

    * The balancing code relocates data extents indepdent of the underlying
    inode. The extent_map code was modified to properly account for
    things moving around (invalidating extent_map caches in the inode).

    * Don't take the drop_mutex in the create_subvol ioctl. It isn't
    required.

    * Fix walking of the ordered extent list to avoid races with sys_unlink

    * Change the lock ordering rules. Transaction start goes outside
    the drop_mutex. This allows btrfs_commit_transaction to directly
    drop the relocation trees.

    Signed-off-by: Chris Mason

    Zheng Yan
     

25 Sep, 2008

4 commits


11 Jul, 2007

1 commit

  • Almost none of the files including module.h need to do so,
    remove them.

    Include sched.h in extent-tree.c to silence a warning about cond_resched()
    being undeclared.

    Signed-off-by: Zach Brown
    Signed-off-by: Chris Mason

    Zach Brown
     

12 Jun, 2007

1 commit


11 Apr, 2007

1 commit


06 Apr, 2007

1 commit


05 Apr, 2007

1 commit


03 Apr, 2007

1 commit


31 Mar, 2007

1 commit


27 Mar, 2007

1 commit


23 Mar, 2007

2 commits


21 Mar, 2007

2 commits