Details
-
Bug
-
Resolution: Fixed
-
Minor
-
None
-
3
-
9223372036854775807
Description
2.6.2 ext4_map_inode_page function's parameter blocks should be 64bit long
There is function with parameter “unsigned long *blocks”:
int ext4_map_inode_page(struct inode *inode, struct page *page, unsigned long *blocks, int create)
But ext4_bmap returns sector_t value.
static sector_t ext4_bmap(struct address_space *mapping, sector_t block)
blocks[i] = ext4_bmap(inode->i_mapping, iblock);
That depending on macros can be 32 or 64 bit long
/** * The type used for indexing onto a disc or disc partition. * * Linux always considers sectors to be 512 bytes long independently * of the devices real block size. * * blkcnt_t is th type of the inode's block count. */ #ifdef CONFIG_LBDAF typedef u64 sector_t; typedef u64 blkcnt_t; #else typedef unsigned long sector_t; typedef unsigned long blkcnt_t; #endif
CONFIG_LBDAF:Enable block devices or files of size 2TB and larger.This option is required to support the full capacity of large (2TB+) block devices, including RAID, disk, Network Block
Device, Logical Volume Manager (LVM) and loopback.This option also enables support for single files larger than 2TB.The ext4 filesystem requires that this feature be enabled in order to support filesystems that have the huge_file feature enabled. Otherwise, it will refuse to mount in the read-write mode any filesystems that use the huge_file feature, which is enabled by default by mke2fs.ext4.The GFS2 filesystem also requires this feature.If unsure, say Y.
So we need to use sector_t for this array of blocks.
The field dr_blocks in osd_iobuf and its users should be corrected
This problem is actual for x86_32 systems only.
Landed for 2.8