Description of problem: I just tried to compile package e2fsprogs-1.35-11 from package Redhat Fedora Core 3 Test 3. The compiler said ext2.c(421): remark #592: variable "bh2" is used before its value is set The source code is struct ext2_buffer_head *bh2; __u32 *udata2; int j; if (!udata[i]) { ext2_brelse(bh, 0); ext2_brelse(bh2, 0); Suggest init bh2 before first use. Version-Release number of selected component (if applicable): How reproducible: Steps to Reproduce: 1. 2. 3. Actual results: Expected results: Additional info:
This is really a problem: void ext2_brelse(struct ext2_buffer_head *bh, int forget) { if (bh->usecount-- == 1 && forget) { if (bh->dirty) ext2_bh_do_write(bh); ext2_bh_dealloc(bh); } }
>This is really a problem: Is the code you provide a proposed solution ? In any event, the original code is still broken in March 2005, some five months later.
The bug is real, but the code is not actually used in this package. That function is only used for "ext2resize" offline resizing and "e2prepare" resize preparation. But these days offline resize is performed by resize2fs in upstream e2fsprogs, and e2prepare is not yet ready for online resize; so neither binaries are actually packaged in our e2fsprogs RPM.