]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
Merge branch 'for-linus-4.10' of git://git.kernel.org/pub/scm/linux/kernel/git/mason...
authorLinus Torvalds <torvalds@linux-foundation.org>
Sat, 14 Jan 2017 01:40:22 +0000 (17:40 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 14 Jan 2017 01:40:22 +0000 (17:40 -0800)
Pull btrfs fixes from Chris Mason:
 "These are all over the place.

  The tracepoint part of the pull fixes a crash and adds a little more
  information to two tracepoints, while the rest are good old fashioned
  fixes"

* 'for-linus-4.10' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs:
  btrfs: make tracepoint format strings more compact
  Btrfs: add truncated_len for ordered extent tracepoints
  Btrfs: add 'inode' for extent map tracepoint
  btrfs: fix crash when tracepoint arguments are freed by wq callbacks
  Btrfs: adjust outstanding_extents counter properly when dio write is split
  Btrfs: fix lockdep warning about log_mutex
  Btrfs: use down_read_nested to make lockdep silent
  btrfs: fix locking when we put back a delayed ref that's too new
  btrfs: fix error handling when run_delayed_extent_op fails
  btrfs: return the actual error value from  from btrfs_uuid_tree_iterate

1  2 
fs/btrfs/inode.c

diff --combined fs/btrfs/inode.c
index f2b281ad7af6b9db26b48c6d4f072a850c19d58a,128e52489f817d7ecc49a0ecfc796623b0164c2f..4e024260ad713ffc583d8f2ffaeb7ba6a025014d
@@@ -7059,7 -7059,7 +7059,7 @@@ insert
        write_unlock(&em_tree->lock);
  out:
  
-       trace_btrfs_get_extent(root, em);
+       trace_btrfs_get_extent(root, inode, em);
  
        btrfs_free_path(path);
        if (trans) {
@@@ -7623,11 -7623,18 +7623,18 @@@ static void adjust_dio_outstanding_exte
         * within our reservation, otherwise we need to adjust our inode
         * counter appropriately.
         */
-       if (dio_data->outstanding_extents) {
+       if (dio_data->outstanding_extents >= num_extents) {
                dio_data->outstanding_extents -= num_extents;
        } else {
+               /*
+                * If dio write length has been split due to no large enough
+                * contiguous space, we need to compensate our inode counter
+                * appropriately.
+                */
+               u64 num_needed = num_extents - dio_data->outstanding_extents;
                spin_lock(&BTRFS_I(inode)->lock);
-               BTRFS_I(inode)->outstanding_extents += num_extents;
+               BTRFS_I(inode)->outstanding_extents += num_needed;
                spin_unlock(&BTRFS_I(inode)->lock);
        }
  }
@@@ -7898,7 -7905,7 +7905,7 @@@ static int dio_read_error(struct inode 
        struct io_failure_record *failrec;
        struct bio *bio;
        int isector;
 -      int read_mode;
 +      int read_mode = 0;
        int ret;
  
        BUG_ON(bio_op(failed_bio) == REQ_OP_WRITE);
        if ((failed_bio->bi_vcnt > 1)
                || (failed_bio->bi_io_vec->bv_len
                        > btrfs_inode_sectorsize(inode)))
 -              read_mode = READ_SYNC | REQ_FAILFAST_DEV;
 -      else
 -              read_mode = READ_SYNC;
 +              read_mode |= REQ_FAILFAST_DEV;
  
        isector = start - btrfs_io_bio(failed_bio)->logical;
        isector >>= inode->i_sb->s_blocksize_bits;
@@@ -8403,7 -8412,7 +8410,7 @@@ static int btrfs_submit_direct_hook(str
        if (!bio)
                return -ENOMEM;
  
 -      bio_set_op_attrs(bio, bio_op(orig_bio), bio_flags(orig_bio));
 +      bio->bi_opf = orig_bio->bi_opf;
        bio->bi_private = dip;
        bio->bi_end_io = btrfs_end_dio_bio;
        btrfs_io_bio(bio)->logical = file_offset;
@@@ -8441,7 -8450,8 +8448,7 @@@ next_block
                                                  start_sector, GFP_NOFS);
                        if (!bio)
                                goto out_err;
 -                      bio_set_op_attrs(bio, bio_op(orig_bio),
 -                                       bio_flags(orig_bio));
 +                      bio->bi_opf = orig_bio->bi_opf;
                        bio->bi_private = dip;
                        bio->bi_end_io = btrfs_end_dio_bio;
                        btrfs_io_bio(bio)->logical = file_offset;
@@@ -10653,6 -10663,7 +10660,6 @@@ static const struct inode_operations bt
        .update_time    = btrfs_update_time,
  };
  static const struct inode_operations btrfs_symlink_inode_operations = {
 -      .readlink       = generic_readlink,
        .get_link       = page_get_link,
        .getattr        = btrfs_getattr,
        .setattr        = btrfs_setattr,