]> Git Repo - J-linux.git/commitdiff
ufs: ufs_sb_private_info: remove unused s_{2,3}apb fields
authorAgathe Porte <[email protected]>
Tue, 12 Nov 2024 12:18:25 +0000 (13:18 +0100)
committerAl Viro <[email protected]>
Wed, 13 Nov 2024 00:02:12 +0000 (19:02 -0500)
These two fields are populated and stored as a "frequently used value"
in ufs_fill_super, but are not used afterwards in the driver.

Moreover, one of the shifts triggers UBSAN: shift-out-of-bounds when
apbshift is 12 because 12 * 3 = 36 and 1 << 36 does not fit in the 32
bit integer used to store the value.

Closes: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/2087853
Signed-off-by: Agathe Porte <[email protected]>
Signed-off-by: Al Viro <[email protected]>
fs/ufs/super.c
fs/ufs/ufs_fs.h

index e876c60e70eac391a2382bac4189160eccab23e2..762699c1bcf684cb6bc90f08e6b03c1e210d0c96 100644 (file)
@@ -1229,11 +1229,7 @@ magic_found:
        else
                uspi->s_apbshift = uspi->s_bshift - 2;
 
-       uspi->s_2apbshift = uspi->s_apbshift * 2;
-       uspi->s_3apbshift = uspi->s_apbshift * 3;
        uspi->s_apb = 1 << uspi->s_apbshift;
-       uspi->s_2apb = 1 << uspi->s_2apbshift;
-       uspi->s_3apb = 1 << uspi->s_3apbshift;
        uspi->s_apbmask = uspi->s_apb - 1;
        uspi->s_nspfshift = uspi->s_fshift - UFS_SECTOR_BITS;
        uspi->s_nspb = uspi->s_nspf << uspi->s_fpbshift;
index ef9ead44776a70fee61c52310205b50ac799292c..0905f9a16b9150b656bd6d8966c0f8cc220b439d 100644 (file)
@@ -775,12 +775,8 @@ struct ufs_sb_private_info {
 
        __u32   s_fpbmask;      /* fragments per block mask */
        __u32   s_apb;          /* address per block */
-       __u32   s_2apb;         /* address per block^2 */
-       __u32   s_3apb;         /* address per block^3 */
        __u32   s_apbmask;      /* address per block mask */
        __u32   s_apbshift;     /* address per block shift */
-       __u32   s_2apbshift;    /* address per block shift * 2 */
-       __u32   s_3apbshift;    /* address per block shift * 3 */
        __u32   s_nspfshift;    /* number of sector per fragment shift */
        __u32   s_nspb;         /* number of sector per block */
        __u32   s_inopf;        /* inodes per fragment */
This page took 0.055868 seconds and 4 git commands to generate.