Date: Fri, 11 Jun 2010 01:52:35 GMT From: Zheng Liu <lz@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 179451 for review Message-ID: <201006110152.o5B1qZKh015769@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://p4web.freebsd.org/@@179451?ac=10 Change 179451 by lz@gnehzuil-freebsd on 2010/06/11 01:52:34 An error in allocating a free block. * calculate end variable incorrectly. Affected files ... .. //depot/projects/soc2010/extfs/src/sys/fs/ext2fs/ext2_alloc.c#24 edit Differences ... ==== //depot/projects/soc2010/extfs/src/sys/fs/ext2fs/ext2_alloc.c#24 (text+ko) ==== @@ -130,8 +130,8 @@ * Otherwise, try to allocate from the beginning of * the window. */ - if (dtog(fs, rp->rsv_start) != cg) - start = phy_blk(cg, fs); + if (dtog(fs, rp->rsv_start) < cg) + start = 0; else start = rp->rsv_start; @@ -140,8 +140,8 @@ * set end variable to the end of this group. * Otherwise, set it to window's end. */ - if (dtog(fs, rp->rsv_end) != cg) - end = fs->e2fs->e2fs_fpg; + if (dtog(fs, rp->rsv_end) > cg) + end = phy_blk(cg + 1, fs) - 1; else end = rp->rsv_end; @@ -154,7 +154,10 @@ goto gotit; } } else - bpref = dtogd(fs, rp->rsv_start); + if (dtog(fs, rp->rsv_start) == cg) + bpref = dtogd(fs, rp->rsv_start); + else + bpref = 0; } else { if (dtog(fs, bpref) != cg) bpref = 0;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201006110152.o5B1qZKh015769>