PERFORCE change 179451 for review
Zheng Liu
lz at FreeBSD.org
Fri Jun 11 01:52:35 UTC 2010
http://p4web.freebsd.org/@@179451?ac=10
Change 179451 by lz at 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;
More information about the p4-projects
mailing list