27 Sep, 2016

3 commits


08 Aug, 2016

1 commit

  • Since commit 63a4cc24867d, bio->bi_rw contains flags in the lower
    portion and the op code in the higher portions. This means that
    old code that relies on manually setting bi_rw is most likely
    going to be broken. Instead of letting that brokeness linger,
    rename the member, to force old and out-of-tree code to break
    at compile time instead of at runtime.

    No intended functional changes in this commit.

    Signed-off-by: Jens Axboe

    Jens Axboe
     

27 Jul, 2016

1 commit

  • Pull core block updates from Jens Axboe:

    - the big change is the cleanup from Mike Christie, cleaning up our
    uses of command types and modified flags. This is what will throw
    some merge conflicts

    - regression fix for the above for btrfs, from Vincent

    - following up to the above, better packing of struct request from
    Christoph

    - a 2038 fix for blktrace from Arnd

    - a few trivial/spelling fixes from Bart Van Assche

    - a front merge check fix from Damien, which could cause issues on
    SMR drives

    - Atari partition fix from Gabriel

    - convert cfq to highres timers, since jiffies isn't granular enough
    for some devices these days. From Jan and Jeff

    - CFQ priority boost fix idle classes, from me

    - cleanup series from Ming, improving our bio/bvec iteration

    - a direct issue fix for blk-mq from Omar

    - fix for plug merging not involving the IO scheduler, like we do for
    other types of merges. From Tahsin

    - expose DAX type internally and through sysfs. From Toshi and Yigal

    * 'for-4.8/core' of git://git.kernel.dk/linux-block: (76 commits)
    block: Fix front merge check
    block: do not merge requests without consulting with io scheduler
    block: Fix spelling in a source code comment
    block: expose QUEUE_FLAG_DAX in sysfs
    block: add QUEUE_FLAG_DAX for devices to advertise their DAX support
    Btrfs: fix comparison in __btrfs_map_block()
    block: atari: Return early for unsupported sector size
    Doc: block: Fix a typo in queue-sysfs.txt
    cfq-iosched: Charge at least 1 jiffie instead of 1 ns
    cfq-iosched: Fix regression in bonnie++ rewrite performance
    cfq-iosched: Convert slice_resid from u64 to s64
    block: Convert fifo_time from ulong to u64
    blktrace: avoid using timespec
    block/blk-cgroup.c: Declare local symbols static
    block/bio-integrity.c: Add #include "blk.h"
    block/partition-generic.c: Remove a set-but-not-used variable
    block: bio: kill BIO_MAX_SIZE
    cfq-iosched: temporarily boost queue priority for idle classes
    block: drbd: avoid to use BIO_MAX_SIZE
    block: bio: remove BIO_MAX_SECTORS
    ...

    Linus Torvalds
     

18 Jun, 2016

1 commit


08 Jun, 2016

5 commits


26 May, 2016

1 commit


05 Apr, 2016

2 commits

  • Mostly direct substitution with occasional adjustment or removing
    outdated comments.

    Signed-off-by: Kirill A. Shutemov
    Acked-by: Michal Hocko
    Signed-off-by: Linus Torvalds

    Kirill A. Shutemov
     
  • PAGE_CACHE_{SIZE,SHIFT,MASK,ALIGN} macros were introduced *long* time
    ago with promise that one day it will be possible to implement page
    cache with bigger chunks than PAGE_SIZE.

    This promise never materialized. And unlikely will.

    We have many places where PAGE_CACHE_SIZE assumed to be equal to
    PAGE_SIZE. And it's constant source of confusion on whether
    PAGE_CACHE_* or PAGE_* constant should be used in a particular case,
    especially on the border between fs and mm.

    Global switching to PAGE_CACHE_SIZE != PAGE_SIZE would cause to much
    breakage to be doable.

    Let's stop pretending that pages in page cache are special. They are
    not.

    The changes are pretty straight-forward:

    - << (PAGE_CACHE_SHIFT - PAGE_SHIFT) -> ;

    - >> (PAGE_CACHE_SHIFT - PAGE_SHIFT) -> ;

    - PAGE_CACHE_{SIZE,SHIFT,MASK,ALIGN} -> PAGE_{SIZE,SHIFT,MASK,ALIGN};

    - page_cache_get() -> get_page();

    - page_cache_release() -> put_page();

    This patch contains automated changes generated with coccinelle using
    script below. For some reason, coccinelle doesn't patch header files.
    I've called spatch for them manually.

    The only adjustment after coccinelle is revert of changes to
    PAGE_CAHCE_ALIGN definition: we are going to drop it later.

    There are few places in the code where coccinelle didn't reach. I'll
    fix them manually in a separate patch. Comments and documentation also
    will be addressed with the separate patch.

    virtual patch

    @@
    expression E;
    @@
    - E << (PAGE_CACHE_SHIFT - PAGE_SHIFT)
    + E

    @@
    expression E;
    @@
    - E >> (PAGE_CACHE_SHIFT - PAGE_SHIFT)
    + E

    @@
    @@
    - PAGE_CACHE_SHIFT
    + PAGE_SHIFT

    @@
    @@
    - PAGE_CACHE_SIZE
    + PAGE_SIZE

    @@
    @@
    - PAGE_CACHE_MASK
    + PAGE_MASK

    @@
    expression E;
    @@
    - PAGE_CACHE_ALIGN(E)
    + PAGE_ALIGN(E)

    @@
    expression E;
    @@
    - page_cache_get(E)
    + get_page(E)

    @@
    expression E;
    @@
    - page_cache_release(E)
    + put_page(E)

    Signed-off-by: Kirill A. Shutemov
    Acked-by: Michal Hocko
    Signed-off-by: Linus Torvalds

    Kirill A. Shutemov
     

14 Mar, 2016

1 commit


12 Mar, 2016

1 commit


11 Mar, 2016

1 commit


07 Jan, 2016

1 commit


22 Oct, 2015

2 commits


08 Oct, 2015

1 commit


29 Jul, 2015

1 commit

  • Currently we have two different ways to signal an I/O error on a BIO:

    (1) by clearing the BIO_UPTODATE flag
    (2) by returning a Linux errno value to the bi_end_io callback

    The first one has the drawback of only communicating a single possible
    error (-EIO), and the second one has the drawback of not beeing persistent
    when bios are queued up, and are not passed along from child to parent
    bio in the ever more popular chaining scenario. Having both mechanisms
    available has the additional drawback of utterly confusing driver authors
    and introducing bugs where various I/O submitters only deal with one of
    them, and the others have to add boilerplate code to deal with both kinds
    of error returns.

    So add a new bi_error field to store an errno value directly in struct
    bio and remove the existing mechanisms to clean all this up.

    Signed-off-by: Christoph Hellwig
    Reviewed-by: Hannes Reinecke
    Reviewed-by: NeilBrown
    Signed-off-by: Jens Axboe

    Christoph Hellwig
     

26 Mar, 2015

1 commit


04 Mar, 2015

1 commit


17 Feb, 2015

1 commit


25 Nov, 2014

1 commit


21 Nov, 2014

3 commits

  • The xfstest btrfs/014 which tests the balance operation caused that the
    check_int module complained that known blocks changed their physical
    location. Since this is not an error in this case, only print such
    message if the verbose mode was enabled.

    Reported-by: Wang Shilong
    Signed-off-by: Stefan Behrens
    Tested-by: Wang Shilong
    Signed-off-by: Chris Mason

    Stefan Behrens
     
  • The xfstest btrfs/014 which tests the balance operation caused issues with
    the check_int module. The attempt was made to use btrfs_map_block() to
    find the physical location for a written block. However, this was not
    at all needed since the location of the written block was known since
    a hook to submit_bio() was the reason for entering the check_int module.
    Additionally, after a block relocation it happened that btrfs_map_block()
    failed causing misleading error messages afterwards.

    This patch changes the check_int module to use the known information of
    the physical location from the bio.

    Reported-by: Wang Shilong
    Signed-off-by: Stefan Behrens
    Tested-by: Wang Shilong
    Signed-off-by: Chris Mason

    Stefan Behrens
     
  • size of @btrfsic_state needs more than 2M, it is very likely to
    fail allocating memory using kzalloc(). see following mesage:

    [91428.902148] Call Trace:
    [] dump_stack+0x4d/0x66
    [] warn_alloc_failed+0xff/0x170
    [] __alloc_pages_nodemask+0x951/0xc30
    [] alloc_pages_current+0x11a/0x1f0
    [] ? alloc_kmem_pages+0x3b/0xf0
    [] alloc_kmem_pages+0x3b/0xf0
    [] kmalloc_order+0x18/0x50
    [] kmalloc_order_trace+0x24/0x140
    [] btrfsic_mount+0x8b/0xae0 [btrfs]
    [] ? check_preempt_curr+0x85/0xa0
    [] ? try_to_wake_up+0x103/0x430
    [] open_ctree+0x1bd0/0x2130 [btrfs]
    [] btrfs_mount+0x62e/0x8b0 [btrfs]
    [] ? alloc_pages_current+0x11a/0x1f0
    [] ? __get_free_pages+0xe/0x50
    [] mount_fs+0x39/0x1b0
    [] vfs_kern_mount+0x6b/0x150
    [] do_mount+0x27b/0xc30
    [] ? __get_free_pages+0xe/0x50
    [] SyS_mount+0x96/0xf0
    [] system_call_fastpath+0x16/0x1b

    Since we are allocating memory for hash table array, so
    it will be good if we could allocate continuous pages here.

    Fix this problem by firstly trying kzalloc(), if we fail,
    use vzalloc() instead.

    Signed-off-by: Wang Shilong
    Signed-off-by: Chris Mason

    Shilong Wang
     

18 Sep, 2014

3 commits

  • total_size will be changed when resizing a device, and disk_total_size
    will be changed if resizing is successful. Meanwhile, the on-disk super
    blocks of the previous transaction might not be updated. Considering
    the consistency of the metadata in the previous transaction, We should
    use the size in the previous transaction to check if the super block is
    beyond the boundary of the device. Fix it.

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

    Miao Xie
     
  • The form

    (value + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT

    is equivalent to

    (value + PAGE_CACHE_SIZE - 1) / PAGE_CACHE_SIZE

    The rest is a simple subsitution, no difference in the generated
    assembly code.

    Signed-off-by: David Sterba
    Signed-off-by: Chris Mason

    David Sterba
     
  • The nodesize and leafsize were never of different values. Unify the
    usage and make nodesize the one. Cleanup the redundant checks and
    helpers.

    Shaves a few bytes from .text:

    text data bss dec hex filename
    852418 24560 23112 900090 dbbfa btrfs.ko.before
    851074 24584 23112 898770 db6d2 btrfs.ko.after

    Signed-off-by: David Sterba
    Signed-off-by: Chris Mason

    David Sterba
     

10 Jun, 2014

1 commit


05 Feb, 2014

1 commit

  • Pull btrfs fixes from Chris Mason:
    "Filipe is fixing compile and boot problems with our crc32c rework, and
    Josef has disabled snapshot aware defrag for now.

    As the number of snapshots increases, we're hitting OOM. For the
    short term we're disabling things until a bigger fix is ready"

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs:
    Btrfs: use late_initcall instead of module_init
    Btrfs: use btrfs_crc32c everywhere instead of libcrc32c
    Btrfs: disable snapshot aware defrag for now

    Linus Torvalds
     

04 Feb, 2014

1 commit

  • After the commit titled "Btrfs: fix btrfs boot when compiled as built-in",
    LIBCRC32C requirement was removed from btrfs' Kconfig. This made it not
    possible to build a kernel with btrfs enabled (either as module or built-in)
    if libcrc32c is not enabled as well. So just replace all uses of libcrc32c
    with the equivalent function in btrfs hash.h - btrfs_crc32c.

    Signed-off-by: Filipe David Borba Manana
    Signed-off-by: Chris Mason

    Filipe David Borba Manana
     

31 Jan, 2014

1 commit

  • Pull btrfs updates from Chris Mason:
    "This is a pretty big pull, and most of these changes have been
    floating in btrfs-next for a long time. Filipe's properties work is a
    cool building block for inheriting attributes like compression down on
    a per inode basis.

    Jeff Mahoney kicked in code to export filesystem info into sysfs.

    Otherwise, lots of performance improvements, cleanups and bug fixes.

    Looks like there are still a few other small pending incrementals, but
    I wanted to get the bulk of this in first"

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs: (149 commits)
    Btrfs: fix spin_unlock in check_ref_cleanup
    Btrfs: setup inode location during btrfs_init_inode_locked
    Btrfs: don't use ram_bytes for uncompressed inline items
    Btrfs: fix btrfs_search_slot_for_read backwards iteration
    Btrfs: do not export ulist functions
    Btrfs: rework ulist with list+rb_tree
    Btrfs: fix memory leaks on walking backrefs failure
    Btrfs: fix send file hole detection leading to data corruption
    Btrfs: add a reschedule point in btrfs_find_all_roots()
    Btrfs: make send's file extent item search more efficient
    Btrfs: fix to catch all errors when resolving indirect ref
    Btrfs: fix protection between walking backrefs and root deletion
    btrfs: fix warning while merging two adjacent extents
    Btrfs: fix infinite path build loops in incremental send
    btrfs: undo sysfs when open_ctree() fails
    Btrfs: fix snprintf usage by send's gen_unique_name
    btrfs: fix defrag 32-bit integer overflow
    btrfs: sysfs: list the NO_HOLES feature
    btrfs: sysfs: don't show reserved incompat feature
    btrfs: call permission checks earlier in ioctls and return EPERM
    ...

    Linus Torvalds
     

29 Jan, 2014

1 commit

  • We were looking at file_extent_num_bytes unconditionally when looking at
    referenced data bytes, but this isn't correct for compression. Fix this by
    checking the compression of the file extent we are and setting num_bytes to
    disk_num_bytes in the case of compression so that we are marking the proper
    bytes as referenced. This fixes check_int_data freaking out when running
    btrfs/004. Thanks,

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

    Josef Bacik
     

06 Dec, 2013

1 commit

  • Pull block layer fixes from Jens Axboe:
    "A small collection of fixes for the current series. It contains:

    - A fix for a use-after-free of a request in blk-mq. From Ming Lei

    - A fix for a blk-mq bug that could attempt to dereference a NULL rq
    if allocation failed

    - Two xen-blkfront small fixes

    - Cleanup of submit_bio_wait() type uses in the kernel, unifying
    that. From Kent

    - A fix for 32-bit blkg_rwstat reading. I apologize for this one
    looking mangled in the shortlog, it's entirely my fault for missing
    an empty line between the description and body of the text"

    * 'for-linus' of git://git.kernel.dk/linux-block:
    blk-mq: fix use-after-free of request
    blk-mq: fix dereference of rq->mq_ctx if allocation fails
    block: xen-blkfront: Fix possible NULL ptr dereference
    xen-blkfront: Silence pfn maybe-uninitialized warning
    block: submit_bio_wait() conversions
    Update of blkg_stat and blkg_rwstat may happen in bh context

    Linus Torvalds
     

25 Nov, 2013

1 commit


24 Nov, 2013

1 commit

  • Immutable biovecs are going to require an explicit iterator. To
    implement immutable bvecs, a later patch is going to add a bi_bvec_done
    member to this struct; for now, this patch effectively just renames
    things.

    Signed-off-by: Kent Overstreet
    Cc: Jens Axboe
    Cc: Geert Uytterhoeven
    Cc: Benjamin Herrenschmidt
    Cc: Paul Mackerras
    Cc: "Ed L. Cashin"
    Cc: Nick Piggin
    Cc: Lars Ellenberg
    Cc: Jiri Kosina
    Cc: Matthew Wilcox
    Cc: Geoff Levand
    Cc: Yehuda Sadeh
    Cc: Sage Weil
    Cc: Alex Elder
    Cc: ceph-devel@vger.kernel.org
    Cc: Joshua Morris
    Cc: Philip Kelleher
    Cc: Rusty Russell
    Cc: "Michael S. Tsirkin"
    Cc: Konrad Rzeszutek Wilk
    Cc: Jeremy Fitzhardinge
    Cc: Neil Brown
    Cc: Alasdair Kergon
    Cc: Mike Snitzer
    Cc: dm-devel@redhat.com
    Cc: Martin Schwidefsky
    Cc: Heiko Carstens
    Cc: linux390@de.ibm.com
    Cc: Boaz Harrosh
    Cc: Benny Halevy
    Cc: "James E.J. Bottomley"
    Cc: Greg Kroah-Hartman
    Cc: "Nicholas A. Bellinger"
    Cc: Alexander Viro
    Cc: Chris Mason
    Cc: "Theodore Ts'o"
    Cc: Andreas Dilger
    Cc: Jaegeuk Kim
    Cc: Steven Whitehouse
    Cc: Dave Kleikamp
    Cc: Joern Engel
    Cc: Prasad Joshi
    Cc: Trond Myklebust
    Cc: KONISHI Ryusuke
    Cc: Mark Fasheh
    Cc: Joel Becker
    Cc: Ben Myers
    Cc: xfs@oss.sgi.com
    Cc: Steven Rostedt
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Len Brown
    Cc: Pavel Machek
    Cc: "Rafael J. Wysocki"
    Cc: Herton Ronaldo Krzesinski
    Cc: Ben Hutchings
    Cc: Andrew Morton
    Cc: Guo Chao
    Cc: Tejun Heo
    Cc: Asai Thambi S P
    Cc: Selvan Mani
    Cc: Sam Bradshaw
    Cc: Wei Yongjun
    Cc: "Roger Pau Monné"
    Cc: Jan Beulich
    Cc: Stefano Stabellini
    Cc: Ian Campbell
    Cc: Sebastian Ott
    Cc: Christian Borntraeger
    Cc: Minchan Kim
    Cc: Jiang Liu
    Cc: Nitin Gupta
    Cc: Jerome Marchand
    Cc: Joe Perches
    Cc: Peng Tao
    Cc: Andy Adamson
    Cc: fanchaoting
    Cc: Jie Liu
    Cc: Sunil Mushran
    Cc: "Martin K. Petersen"
    Cc: Namjae Jeon
    Cc: Pankaj Kumar
    Cc: Dan Magenheimer
    Cc: Mel Gorman 6

    Kent Overstreet