Merge branch 'for-4.14-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave...
authorLinus Torvalds <torvalds@linux-foundation.org>
Fri, 6 Oct 2017 16:03:08 +0000 (09:03 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 6 Oct 2017 16:03:08 +0000 (09:03 -0700)
Pull btrfs fixes from David Sterba:
 "Two more fixes for bugs introduced in 4.13.

  The sector_t problem with 32bit architecture and !LBDAF config seems
  serious but the number of affected deployments is hopefully low.

  The clashing status bits could lead to a confusing in-memory state of
  the whole-filesystem operations if used with the quota override sysfs
  knob"

* 'for-4.14-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux:
  Btrfs: fix overlap of fs_info::flags values
  btrfs: avoid overflow when sector_t is 32 bit

1  2 
fs/btrfs/ctree.h
fs/btrfs/extent_io.c

diff --combined fs/btrfs/ctree.h
index 899ddaeeacec8dcf1bf280e6c3b30c30eaa8c8c2,aff3248beb9080a0c9b31f3dd286e71167f93faa..8fc690384c585779a9a6838b08228b41468a49b6
@@@ -270,7 -270,6 +270,7 @@@ struct btrfs_super_block 
         BTRFS_FEATURE_INCOMPAT_MIXED_GROUPS |          \
         BTRFS_FEATURE_INCOMPAT_BIG_METADATA |          \
         BTRFS_FEATURE_INCOMPAT_COMPRESS_LZO |          \
 +       BTRFS_FEATURE_INCOMPAT_COMPRESS_ZSTD |         \
         BTRFS_FEATURE_INCOMPAT_RAID56 |                \
         BTRFS_FEATURE_INCOMPAT_EXTENDED_IREF |         \
         BTRFS_FEATURE_INCOMPAT_SKINNY_METADATA |       \
@@@ -722,7 -721,7 +722,7 @@@ struct btrfs_delayed_root
   * Indicate that a whole-filesystem exclusive operation is running
   * (device replace, resize, device add/delete, balance)
   */
- #define BTRFS_FS_EXCL_OP                      14
+ #define BTRFS_FS_EXCL_OP                      16
  
  struct btrfs_fs_info {
        u8 fsid[BTRFS_FSID_SIZE];
diff --combined fs/btrfs/extent_io.c
index 12ab19a4b93e16167d3c58f3a4991ed979fe46e5,8dfa181b1a927137689f9c16c4c29c1d2432ece0..970190cd347edd5878479618222dc814b4736573
@@@ -2032,7 -2032,7 +2032,7 @@@ int repair_io_failure(struct btrfs_fs_i
                bio_put(bio);
                return -EIO;
        }
 -      bio->bi_bdev = dev->bdev;
 +      bio_set_dev(bio, dev->bdev);
        bio->bi_opf = REQ_OP_WRITE | REQ_SYNC;
        bio_add_page(bio, page, length, pg_offset);
  
@@@ -2060,7 -2060,7 +2060,7 @@@ int repair_eb_io_failure(struct btrfs_f
        unsigned long i, num_pages = num_extent_pages(eb->start, eb->len);
        int ret = 0;
  
 -      if (fs_info->sb->s_flags & MS_RDONLY)
 +      if (sb_rdonly(fs_info->sb))
                return -EROFS;
  
        for (i = 0; i < num_pages; i++) {
@@@ -2110,7 -2110,7 +2110,7 @@@ int clean_io_failure(struct btrfs_fs_in
                        failrec->start);
                goto out;
        }
 -      if (fs_info->sb->s_flags & MS_RDONLY)
 +      if (sb_rdonly(fs_info->sb))
                goto out;
  
        spin_lock(&io_tree->lock);
@@@ -2334,7 -2334,7 +2334,7 @@@ struct bio *btrfs_create_repair_bio(str
        bio = btrfs_io_bio_alloc(1);
        bio->bi_end_io = endio_func;
        bio->bi_iter.bi_sector = failrec->logical >> 9;
 -      bio->bi_bdev = fs_info->fs_devices->latest_bdev;
 +      bio_set_dev(bio, fs_info->fs_devices->latest_bdev);
        bio->bi_iter.bi_size = 0;
        bio->bi_private = data;
  
@@@ -2674,7 -2674,7 +2674,7 @@@ struct bio *btrfs_bio_alloc(struct bloc
        struct bio *bio;
  
        bio = bio_alloc_bioset(GFP_NOFS, BIO_MAX_PAGES, btrfs_bioset);
 -      bio->bi_bdev = bdev;
 +      bio_set_dev(bio, bdev);
        bio->bi_iter.bi_sector = first_byte >> 9;
        btrfs_io_bio_init(btrfs_io_bio(bio));
        return bio;
@@@ -2801,7 -2801,7 +2801,7 @@@ static int submit_extent_page(unsigned 
                }
        }
  
-       bio = btrfs_bio_alloc(bdev, sector << 9);
+       bio = btrfs_bio_alloc(bdev, (u64)sector << 9);
        bio_add_page(bio, page, page_size, offset);
        bio->bi_end_io = end_io_func;
        bio->bi_private = tree;