Showing error 1675

User: Jiri Slaby
Error type: Invalid Pointer Dereference
Error type description: A pointer which is invalid is being dereferenced
File location: fs/xfs/xfs_rtalloc.c
Line in file: 1945
Project: Linux Kernel
Project version: 2.6.28
Tools: Smatch (1.59)
Entered: 2013-09-10 07:54:05 UTC


Source:

1915                return XFS_ERROR(EINVAL);
1916        /*
1917         * Get the old block counts for bitmap and summary inodes.
1918         * These can't change since other growfs callers are locked out.
1919         */
1920        rbmblocks = XFS_B_TO_FSB(mp, mp->m_rbmip->i_d.di_size);
1921        rsumblocks = XFS_B_TO_FSB(mp, mp->m_rsumip->i_d.di_size);
1922        /*
1923         * Allocate space to the bitmap and summary files, as necessary.
1924         */
1925        if ((error = xfs_growfs_rt_alloc(mp, rbmblocks, nrbmblocks,
1926                        mp->m_sb.sb_rbmino)))
1927                return error;
1928        if ((error = xfs_growfs_rt_alloc(mp, rsumblocks, nrsumblocks,
1929                        mp->m_sb.sb_rsumino)))
1930                return error;
1931        /*
1932         * Allocate a new (fake) mount/sb.
1933         */
1934        nmp = kmem_alloc(sizeof(*nmp), KM_SLEEP);
1935        /*
1936         * Loop over the bitmap blocks.
1937         * We will do everything one bitmap block at a time.
1938         * Skip the current block if it is exactly full.
1939         * This also deals with the case where there were no rtextents before.
1940         */
1941        for (bmbno = sbp->sb_rbmblocks -
1942                     ((sbp->sb_rextents & ((1 << mp->m_blkbit_log) - 1)) != 0);
1943             bmbno < nrbmblocks;
1944             bmbno++) {
1945                *nmp = *mp;
1946                nsbp = &nmp->m_sb;
1947                /*
1948                 * Calculate new sb and mount fields for this round.
1949                 */
1950                nsbp->sb_rextsize = in->extsize;
1951                nsbp->sb_rbmblocks = bmbno + 1;
1952                nsbp->sb_rblocks =
1953                        XFS_RTMIN(nrblocks,
1954                                  nsbp->sb_rbmblocks * NBBY *
1955                                  nsbp->sb_blocksize * nsbp->sb_rextsize);
Show full sources