Merge tag 'for-5.1-rc2-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave...
authorLinus Torvalds <torvalds@linux-foundation.org>
Tue, 26 Mar 2019 17:32:13 +0000 (10:32 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 26 Mar 2019 17:32:13 +0000 (10:32 -0700)
Pull btrfs fixes from David Sterba:

 - fsync fixes: i_size for truncate vs fsync, dio vs buffered during
   snapshotting, remove complicated but incomplete assertion

 - removed excessive warnigs, misreported device stats updates

 - fix raid56 page mapping for 32bit arch

 - fixes reported by static analyzer

* tag 'for-5.1-rc2-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux:
  Btrfs: fix assertion failure on fsync with NO_HOLES enabled
  btrfs: Avoid possible qgroup_rsv_size overflow in btrfs_calculate_inode_block_rsv_size
  btrfs: Fix bound checking in qgroup_trace_new_subtree_blocks
  btrfs: raid56: properly unmap parity page in finish_parity_scrub()
  btrfs: don't report readahead errors and don't update statistics
  Btrfs: fix file corruption after snapshotting due to mix of buffered/DIO writes
  btrfs: remove WARN_ON in log_dir_items
  Btrfs: fix incorrect file size after shrinking truncate and fsync

1  2 
fs/btrfs/raid56.c

diff --combined fs/btrfs/raid56.c
index 1869ba8e5981c948c435bf26e3c2f9d8016770b0,6976e22807713f40ce4b21e0d7bc6beea04c58e6..67a6f7d4740230aaa24b1ecad5e91ec5b94b5f70
@@@ -1443,11 -1443,10 +1443,11 @@@ static void set_bio_pages_uptodate(stru
  {
        struct bio_vec *bvec;
        int i;
 +      struct bvec_iter_all iter_all;
  
        ASSERT(!bio_flagged(bio, BIO_CLONED));
  
 -      bio_for_each_segment_all(bvec, bio, i)
 +      bio_for_each_segment_all(bvec, bio, i, iter_all)
                SetPageUptodate(bvec->bv_page);
  }
  
@@@ -2430,8 -2429,9 +2430,9 @@@ static noinline void finish_parity_scru
                        bitmap_clear(rbio->dbitmap, pagenr, 1);
                kunmap(p);
  
-               for (stripe = 0; stripe < rbio->real_stripes; stripe++)
+               for (stripe = 0; stripe < nr_data; stripe++)
                        kunmap(page_in_rbio(rbio, stripe, pagenr, 0));
+               kunmap(p_page);
        }
  
        __free_page(p_page);