27 May, 2011

2 commits

  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/djm/tmem:
    xen: cleancache shim to Xen Transcendent Memory
    ocfs2: add cleancache support
    ext4: add cleancache support
    btrfs: add cleancache support
    ext3: add cleancache support
    mm/fs: add hooks to support cleancache
    mm: cleancache core ops functions and config
    fs: add field to superblock to support cleancache
    mm/fs: cleancache documentation

    Fix up trivial conflict in fs/btrfs/extent_io.c due to includes

    Linus Torvalds
     
  • This sixth patch of eight in this cleancache series "opts-in"
    cleancache for btrfs. Filesystems must explicitly enable
    cleancache by calling cleancache_init_fs anytime an instance
    of the filesystem is mounted. Btrfs uses its own readpage
    which must be hooked, but all other cleancache hooks are in
    the VFS layer including the matching cleancache_flush_fs hook
    which must be called on unmount.

    Details and a FAQ can be found in Documentation/vm/cleancache.txt

    [v6-v8: no changes]
    [v5: jeremy@goop.org: simplify init hook and any future fs init changes]
    Signed-off-by: Dan Magenheimer
    Signed-off-by: Chris Mason
    Reviewed-by: Jeremy Fitzhardinge
    Reviewed-by: Konrad Rzeszutek Wilk
    Cc: Andrew Morton
    Cc: Al Viro
    Cc: Matthew Wilcox
    Cc: Nick Piggin
    Cc: Mel Gorman
    Cc: Rik Van Riel
    Cc: Jan Beulich
    Cc: Andreas Dilger
    Cc: Ted Ts'o
    Cc: Mark Fasheh
    Cc: Joel Becker
    Cc: Nitin Gupta

    Dan Magenheimer
     

24 May, 2011

1 commit

  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (39 commits)
    b43: fix comment typo reqest -> request
    Haavard Skinnemoen has left Atmel
    cris: typo in mach-fs Makefile
    Kconfig: fix copy/paste-ism for dell-wmi-aio driver
    doc: timers-howto: fix a typo ("unsgined")
    perf: Only include annotate.h once in tools/perf/util/ui/browsers/annotate.c
    md, raid5: Fix spelling error in comment ('Ofcourse' --> 'Of course').
    treewide: fix a few typos in comments
    regulator: change debug statement be consistent with the style of the rest
    Revert "arm: mach-u300/gpio: Fix mem_region resource size miscalculations"
    audit: acquire creds selectively to reduce atomic op overhead
    rtlwifi: don't touch with treewide double semicolon removal
    treewide: cleanup continuations and remove logging message whitespace
    ath9k_hw: don't touch with treewide double semicolon removal
    include/linux/leds-regulator.h: fix syntax in example code
    tty: fix typo in descripton of tty_termios_encode_baud_rate
    xtensa: remove obsolete BKL kernel option from defconfig
    m68k: fix comment typo 'occcured'
    arch:Kconfig.locks Remove unused config option.
    treewide: remove extra semicolons
    ...

    Linus Torvalds
     

21 May, 2011

1 commit

  • Commit e66eed651fd1 ("list: remove prefetching from regular list
    iterators") removed the include of prefetch.h from list.h, which
    uncovered several cases that had apparently relied on that rather
    obscure header file dependency.

    So this fixes things up a bit, using

    grep -L linux/prefetch.h $(git grep -l '[^a-z_]prefetchw*(' -- '*.[ch]')
    grep -L 'prefetchw*(' $(git grep -l 'linux/prefetch.h' -- '*.[ch]')

    to guide us in finding files that either need
    inclusion, or have it despite not needing it.

    There are more of them around (mostly network drivers), but this gets
    many core ones.

    Reported-by: Stephen Rothwell
    Signed-off-by: Linus Torvalds

    Linus Torvalds
     

16 May, 2011

1 commit


15 May, 2011

5 commits

  • Steps to reproduce the bug:

    - Call FS_IOC_SETLFAGS ioctl with flags=FS_COMPR_FL
    - Call FS_IOC_SETFLAGS ioctl with flags=0
    - Call FS_IOC_GETFLAGS ioctl, and you'll see FS_COMPR_FL is still set!

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

    Li Zefan
     
  • As we've added per file compression/cow support.

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

    Li Zefan
     
  • FS_COW_FL and FS_NOCOW_FL were newly introduced to control per file
    COW in btrfs, but FS_NOCOW_FL is sufficient.

    The fact is we don't have corresponding BTRFS_INODE_COW flag.

    COW is default, and FS_NOCOW_FL can be used to switch off COW for
    a single file.

    If we mount btrfs with nodatacow, a newly created file will be set with
    the FS_NOCOW_FL flag. So to turn on COW for it, we can just clear the
    FS_NOCOW_FL flag.

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

    Li Zefan
     
  • When a btrfs disk is created by mixed data & metadata option, it will have no
    pure data or pure metadata space info.

    In btrfs's for-linus branch, commit 78b1ea13838039cd88afdd62519b40b344d6c920
    (Btrfs: fix OOPS of empty filesystem after balance) initializes space infos at
    the very beginning. The problem is this initialization does not take the mixed
    case into account, which will cause btrfs will easily get into ENOSPC in mixed
    case.

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

    liubo
     
  • If posix_acl_from_xattr() returns an error code, a negative address is
    dereferenced causing an oops; fix by checking for error code first.

    Signed-off-by: Daniel J Blueman
    Reviewed-by: Josef Bacik
    Signed-off-by: Chris Mason

    Daniel J Blueman
     

10 May, 2011

1 commit


27 Apr, 2011

1 commit


26 Apr, 2011

9 commits


20 Apr, 2011

1 commit

  • The Btrfs submit bio threads have a small number of
    threads responsible for pushing down bios we've collected
    for a large number of devices.

    Since we do all the bios for a single device at once,
    we want to make sure we unplug and send down the bios
    for each device as we're done processing them.

    The new plugging API removed the btrfs code to
    unplug while processing bios, this adds it back with
    the new API.

    Signed-off-by: Chris Mason

    Chris Mason
     

19 Apr, 2011

1 commit

  • * git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable: (24 commits)
    Btrfs: fix free space cache leak
    Btrfs: avoid taking the chunk_mutex in do_chunk_alloc
    Btrfs end_bio_extent_readpage should look for locked bits
    Btrfs: don't force chunk allocation in find_free_extent
    Btrfs: Check validity before setting an acl
    Btrfs: Fix incorrect inode nlink in btrfs_link()
    Btrfs: Check if btrfs_next_leaf() returns error in btrfs_real_readdir()
    Btrfs: Check if btrfs_next_leaf() returns error in btrfs_listxattr()
    Btrfs: make uncache_state unconditional
    btrfs: using cached extent_state in set/unlock combinations
    Btrfs: avoid taking the trans_mutex in btrfs_end_transaction
    Btrfs: fix subvolume mount by name problem when default mount subvolume is set
    fix user annotation in ioctl.c
    Btrfs: check for duplicate iov_base's when doing dio reads
    btrfs: properly handle overlapping areas in memmove_extent_buffer
    Btrfs: fix memory leaks in btrfs_new_inode()
    Btrfs: check for duplicate iov_base's when doing dio reads
    Btrfs: reuse the extent_map we found when calling btrfs_get_extent
    Btrfs: do not use async submit for small DIO io's
    Btrfs: don't split dio bios if we don't have to
    ...

    Linus Torvalds
     

18 Apr, 2011

1 commit

  • The free space caching code was recently reworked to
    cache all the pages it needed instead of using find_get_page everywhere.

    One loop was missed though, so it ended up leaking pages. This fixes
    it to use our page array instead of find_get_page.

    Signed-off-by: Chris Mason

    Chris Mason
     

16 Apr, 2011

3 commits

  • Everytime we try to allocate disk space we try and see if we can pre-emptively
    allocate a chunk, but in the common case we don't allocate anything, so there is
    no sense in taking the chunk_mutex at all. So instead if we are allocating a
    chunk, mark it in the space_info so we don't get two people trying to allocate
    at the same time. Thanks,

    Signed-off-by: Josef Bacik
    Reviewed-by: Liu Bo

    Josef Bacik
     
  • A recent commit caches the extent state in end_bio_extent_readpage,
    but the search it does should look for locked extents. This
    fixes things to make it more effective.

    Signed-off-by: Chris Mason

    Chris Mason
     
  • find_free_extent likes to allocate in contiguous clusters,
    which makes writeback faster, especially on SSD storage. As
    the FS fragments, these clusters become harder to find and we have
    to decide between allocating a new chunk to make more clusters
    or giving up on the cluster to allocate from the free space
    we have.

    Right now it creates too many chunks, and you can end up with
    a whole FS that is mostly empty metadata chunks. This commit
    changes the allocation code to be more strict and only
    allocate new chunks when we've made good use of the chunks we
    already have.

    Signed-off-by: Chris Mason

    Chris Mason
     

13 Apr, 2011

5 commits


12 Apr, 2011

8 commits

  • …btrfs-work into for-linus

    Chris Mason
     
  • In several places the sequence (set_extent_uptodate, unlock_extent) is used.
    This leads to a duplicate lookup of the extent state. This patch lets
    set_extent_uptodate return a cached extent_state which can be passed to
    unlock_extent_cached.
    The occurences of the above sequences are updated to use the cache. Only
    end_bio_extent_readpage is updated that it first gets a cached state to
    pass it to the readpage_end_io_hook as the prototype requested and is later
    on being used for set/unlock.

    Signed-off-by: Arne Jansen
    Signed-off-by: Chris Mason

    Arne Jansen
     
  • I've been working on making our O_DIRECT latency not suck and I noticed we were
    taking the trans_mutex in btrfs_end_transaction. So to do this we convert
    num_writers and use_count to atomic_t's and just decrement them in
    btrfs_end_transaction. Instead of deleting the transaction from the trans list
    in put_transaction we do that in btrfs_commit_transaction() since that's the
    only time it actually needs to be removed from the list. Thanks,

    Signed-off-by: Josef Bacik

    Josef Bacik
     
  • We create two subvolumes (meego_root and meego_home) in
    btrfs root directory. And set meego_root as default mount
    subvolume. After we remount btrfs, meego_root is mounted
    to top directory by default. Then when we try to mount
    meego_home (subvol=meego_home) to a subdirectory, it failed.
    The problem is when default mount subvolume is set to
    meego_root, we search meego_home in meego_root but can not find
    it. So the solution is to add a new mount option (subvolrootid)
    to specify subvol id of root and search subvol name in it. For
    our case, now we can use "-o subvolrootid=0,subvol=meego_home)
    to mount meego_home.

    Detail information can be found in meego bugzilla:
    https://bugs.meego.com/show_bug.cgi?id=15055

    Signed-off-by: Zhong, Xin
    Signed-off-by: Chris Mason

    Xin Zhong
     
  • Fix address space annotation correct in ioctl.c.

    Signed-off-by: Daniel J Blueman

    BTRFS_BLOCK_GROUP_SYSTEM,
    @@ -2387,7 +2387,7 @@ long btrfs_ioctl_space_info(struct btrfs_root
    *root, void __user *arg)
    up_read(&info->groups_sem);
    }

    - user_dest = (struct btrfs_ioctl_space_info *)
    + user_dest = (struct btrfs_ioctl_space_info __user *)
    (arg + sizeof(struct btrfs_ioctl_space_args));

    if (copy_to_user(user_dest, dest_orig, alloc_size))
    Reviewed-by: Josef Bacik
    Signed-off-by: Chris Mason

    Daniel J Blueman
     
  • Apparently it is ok to submit a read to an IDE device with the same target page
    for different offsets. This is what Windows does under qemu. The problem is
    under DIO we expect them to be different buffers for checksumming reasons, and
    so this sort of thing will result in checksum errors, when in reality the file
    is fine. So when reading, check to make sure that all iov bases are different,
    and if they aren't fall back to buffered mode, since that will work out right.
    Thanks,

    Signed-off-by: Josef Bacik
    Signed-off-by: Chris Mason

    Josef Bacik
     
  • Fix data corruption caused by memcpy() usage on overlapping data.
    I've observed it first when found out usermode linux crash on btrfs.

    ?all chain is the following:
    ------------[ cut here ]------------
    WARNING: at /home/slyfox/linux-2.6/fs/btrfs/extent_io.c:3900 memcpy_extent_buffer+0x1a5/0x219()
    Call Trace:
    6fa39a58: [] _raw_spin_unlock_irqrestore+0x18/0x1c
    6fa39a68: [] warn_slowpath_common+0x59/0x70
    6fa39aa8: [] warn_slowpath_null+0x15/0x17
    6fa39ab8: [] memcpy_extent_buffer+0x1a5/0x219
    6fa39b48: [] memmove_extent_buffer+0x94/0x208
    6fa39bc8: [] btrfs_del_items+0x214/0x473
    6fa39c78: [] btrfs_delete_one_dir_name+0x7c/0xda
    6fa39cc8: [] __btrfs_unlink_inode+0xad/0x25d
    6fa39d08: [] btrfs_start_transaction+0xe/0x10
    6fa39d48: [] btrfs_unlink_inode+0x1b/0x3b
    6fa39d78: [] btrfs_unlink+0x70/0xef
    6fa39dc8: [] vfs_unlink+0x58/0xa3
    6fa39df8: [] do_unlinkat+0xd4/0x162
    6fa39e48: [] call_rcu_sched+0xe/0x10
    6fa39e58: [] __put_cred+0x58/0x5a
    6fa39e78: [] sys_faccessat+0x154/0x166
    6fa39ed8: [] sys_unlink+0x11/0x13
    6fa39ee8: [] handle_syscall+0x58/0x70
    6fa39f08: [] userspace+0x2d4/0x381
    6fa39fc8: [] fork_handler+0x62/0x69
    ---[ end trace 70b0ca2ef0266b93 ]---

    http://www.mail-archive.com/linux-btrfs@vger.kernel.org/msg09302.html

    Signed-off-by: Sergei Trofimovich
    Reviewed-by: Josef Bacik
    Signed-off-by: Chris Mason

    Sergei Trofimovich
     
  • This patch fixes memory leaks in btrfs_new_inode().

    Signed-off-by: Yoshinori Sano
    Signed-off-by: Chris Mason

    Yoshinori Sano