Merge branch 'for-linus-4.11' of git://git.kernel.org/pub/scm/linux/kernel/git/mason...
authorLinus Torvalds <torvalds@linux-foundation.org>
Sat, 1 Apr 2017 00:58:48 +0000 (17:58 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 1 Apr 2017 00:58:48 +0000 (17:58 -0700)
Pull btrfs fixes from Chris Mason:
 "We have three small fixes queued up in my for-linus-4.11 branch"

* 'for-linus-4.11' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs:
  Btrfs: fix an integer overflow check
  btrfs: Change qgroup_meta_rsv to 64bit
  Btrfs: bring back repair during read

1  2 
fs/btrfs/ctree.h
fs/btrfs/disk-io.c
fs/btrfs/inode.c

diff --combined fs/btrfs/ctree.h
index 29b7fc28c607232987cc3b28fbe9a92e0f766df7,660d485b6e8b14934effa267c2884a90d7a0c99f..c4115901d9064f68217c3be825f233d7d6872cf6
@@@ -20,7 -20,6 +20,7 @@@
  #define __BTRFS_CTREE__
  
  #include <linux/mm.h>
 +#include <linux/sched/signal.h>
  #include <linux/highmem.h>
  #include <linux/fs.h>
  #include <linux/rwsem.h>
@@@ -1259,7 -1258,7 +1259,7 @@@ struct btrfs_root 
        atomic_t will_be_snapshoted;
  
        /* For qgroup metadata space reserve */
-       atomic_t qgroup_meta_rsv;
+       atomic64_t qgroup_meta_rsv;
  };
  static inline u32 btrfs_inode_sectorsize(const struct inode *inode)
  {
@@@ -3155,7 -3154,7 +3155,7 @@@ int btrfs_create_subvol_root(struct btr
  int btrfs_merge_bio_hook(struct page *page, unsigned long offset,
                         size_t size, struct bio *bio,
                         unsigned long bio_flags);
 -int btrfs_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf);
 +int btrfs_page_mkwrite(struct vm_fault *vmf);
  int btrfs_readpage(struct file *file, struct page *page);
  void btrfs_evict_inode(struct inode *inode);
  int btrfs_write_inode(struct inode *inode, struct writeback_control *wbc);
diff --combined fs/btrfs/disk-io.c
index 08b74daf35d05f70dac01adbac73d10925f50879,982c56f7951517fd562f3a1d07f34af5d7e670a0..eb1ee7b6f532b74409a6bb50fdb204cb2c8332a1
@@@ -1342,7 -1342,7 +1342,7 @@@ static void __setup_root(struct btrfs_r
        atomic_set(&root->orphan_inodes, 0);
        atomic_set(&root->refs, 1);
        atomic_set(&root->will_be_snapshoted, 0);
-       atomic_set(&root->qgroup_meta_rsv, 0);
+       atomic64_set(&root->qgroup_meta_rsv, 0);
        root->log_transid = 0;
        root->log_transid_committed = -1;
        root->last_log_commit = 0;
@@@ -1798,7 -1798,7 +1798,7 @@@ static int btrfs_congested_fn(void *con
        list_for_each_entry_rcu(device, &info->fs_devices->devices, dev_list) {
                if (!device->bdev)
                        continue;
 -              bdi = blk_get_backing_dev_info(device->bdev);
 +              bdi = device->bdev->bd_bdi;
                if (bdi_congested(bdi, bdi_bits)) {
                        ret = 1;
                        break;
diff --combined fs/btrfs/inode.c
index 2315039356529fac0315a57733a035d86a00b3b1,876f1d36030c1cfd654e1da347526e87875c173e..a18510be76c141e5d4b4d687c2eb5498cc273c56
@@@ -8908,10 -8908,10 +8908,10 @@@ again
   * beyond EOF, then the page is guaranteed safe against truncation until we
   * unlock the page.
   */
 -int btrfs_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf)
 +int btrfs_page_mkwrite(struct vm_fault *vmf)
  {
        struct page *page = vmf->page;
 -      struct inode *inode = file_inode(vma->vm_file);
 +      struct inode *inode = file_inode(vmf->vma->vm_file);
        struct btrfs_fs_info *fs_info = btrfs_sb(inode->i_sb);
        struct extent_io_tree *io_tree = &BTRFS_I(inode)->io_tree;
        struct btrfs_ordered_extent *ordered;
        ret = btrfs_delalloc_reserve_space(inode, page_start,
                                           reserved_space);
        if (!ret) {
 -              ret = file_update_time(vma->vm_file);
 +              ret = file_update_time(vmf->vma->vm_file);
                reserved = 1;
        }
        if (ret) {
@@@ -9427,11 -9427,11 +9427,11 @@@ fail
        return -ENOMEM;
  }
  
 -static int btrfs_getattr(struct vfsmount *mnt,
 -                       struct dentry *dentry, struct kstat *stat)
 +static int btrfs_getattr(const struct path *path, struct kstat *stat,
 +                       u32 request_mask, unsigned int flags)
  {
        u64 delalloc_bytes;
 -      struct inode *inode = d_inode(dentry);
 +      struct inode *inode = d_inode(path->dentry);
        u32 blocksize = inode->i_sb->s_blocksize;
  
        generic_fillattr(inode, stat);
@@@ -10523,9 -10523,9 +10523,9 @@@ out_inode
  }
  
  __attribute__((const))
- static int dummy_readpage_io_failed_hook(struct page *page, int failed_mirror)
+ static int btrfs_readpage_io_failed_hook(struct page *page, int failed_mirror)
  {
-       return 0;
+       return -EAGAIN;
  }
  
  static const struct inode_operations btrfs_dir_inode_operations = {
@@@ -10570,7 -10570,7 +10570,7 @@@ static const struct extent_io_ops btrfs
        .submit_bio_hook = btrfs_submit_bio_hook,
        .readpage_end_io_hook = btrfs_readpage_end_io_hook,
        .merge_bio_hook = btrfs_merge_bio_hook,
-       .readpage_io_failed_hook = dummy_readpage_io_failed_hook,
+       .readpage_io_failed_hook = btrfs_readpage_io_failed_hook,
  
        /* optional callbacks */
        .fill_delalloc = run_delalloc_range,