Merge tag 'for-5.2/block-20190507' of git://git.kernel.dk/linux-block
[sfrench/cifs-2.6.git] / fs / ext4 / super.c
index 981f702848e7ac653bf226fd17ce018c17011502..0e63069b9d5bd75cb781c32912957ca36d3cc6f3 100644 (file)
@@ -2705,13 +2705,9 @@ static loff_t ext4_max_size(int blkbits, int has_huge_files)
        loff_t res;
        loff_t upper_limit = MAX_LFS_FILESIZE;
 
-       /* small i_blocks in vfs inode? */
-       if (!has_huge_files || sizeof(blkcnt_t) < sizeof(u64)) {
-               /*
-                * CONFIG_LBDAF is not enabled implies the inode
-                * i_block represent total blocks in 512 bytes
-                * 32 == size of vfs inode i_blocks * 8
-                */
+       BUILD_BUG_ON(sizeof(blkcnt_t) < sizeof(u64));
+
+       if (!has_huge_files) {
                upper_limit = (1LL << 32) - 1;
 
                /* total blocks in file system block size */
@@ -2752,11 +2748,11 @@ static loff_t ext4_max_bitmap_size(int bits, int has_huge_files)
         * number of 512-byte sectors of the file.
         */
 
-       if (!has_huge_files || sizeof(blkcnt_t) < sizeof(u64)) {
+       if (!has_huge_files) {
                /*
-                * !has_huge_files or CONFIG_LBDAF not enabled implies that
-                * the inode i_block field represents total file blocks in
-                * 2^32 512-byte sectors == size of vfs inode i_blocks * 8
+                * !has_huge_files or implies that the inode i_block field
+                * represents total file blocks in 2^32 512-byte sectors ==
+                * size of vfs inode i_blocks * 8
                 */
                upper_limit = (1LL << 32) - 1;
 
@@ -2896,18 +2892,6 @@ static int ext4_feature_set_ok(struct super_block *sb, int readonly)
                                ~EXT4_FEATURE_RO_COMPAT_SUPP));
                return 0;
        }
-       /*
-        * Large file size enabled file system can only be mounted
-        * read-write on 32-bit systems if kernel is built with CONFIG_LBDAF
-        */
-       if (ext4_has_feature_huge_file(sb)) {
-               if (sizeof(blkcnt_t) < sizeof(u64)) {
-                       ext4_msg(sb, KERN_ERR, "Filesystem with huge files "
-                                "cannot be mounted RDWR without "
-                                "CONFIG_LBDAF");
-                       return 0;
-               }
-       }
        if (ext4_has_feature_bigalloc(sb) && !ext4_has_feature_extents(sb)) {
                ext4_msg(sb, KERN_ERR,
                         "Can't support bigalloc feature without "
@@ -4056,8 +4040,6 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
        if (err) {
                ext4_msg(sb, KERN_ERR, "filesystem"
                         " too large to mount safely on this system");
-               if (sizeof(sector_t) < 8)
-                       ext4_msg(sb, KERN_WARNING, "CONFIG_LBDAF not enabled");
                goto failed_mount;
        }