Description of problem: While trying to convert a fresh GFS file system to GFS2, gfs2_convert got stuck in a busy loop. Attaching to it with gdb shows the following loop. (gdb) print sdp->num_bufs $4 = 32769 (gdb) print sdp->bsize $5 = 4096 (gdb) watch sdp->num_bufs Hardware watchpoint 1: sdp->num_bufs (gdb) watch sdp->bsize Hardware watchpoint 2: sdp->bsize (gdb) n 62 osi_list_add(&bh->b_list, &sdp->buf_list); (gdb) 63 continue; (gdb) 57 while (sdp->num_bufs * sdp->bsize > 128 << 20) { (gdb) 58 bh = osi_list_entry(sdp->buf_list.prev, struct gfs2_buffer_head, (gdb) 60 if (bh->b_count) { (gdb) 61 osi_list_del(&bh->b_list); (gdb) 62 osi_list_add(&bh->b_list, &sdp->buf_list); (gdb) 63 continue; (gdb) 57 while (sdp->num_bufs * sdp->bsize > 128 << 20) { (gdb) 58 bh = osi_list_entry(sdp->buf_list.prev, struct gfs2_buffer_head, (gdb) 60 if (bh->b_count) { (gdb) 61 osi_list_del(&bh->b_list); (gdb) 62 osi_list_add(&bh->b_list, &sdp->buf_list); (gdb) 63 continue; (gdb) 57 while (sdp->num_bufs * sdp->bsize > 128 << 20) { (gdb) 58 bh = osi_list_entry(sdp->buf_list.prev, struct gfs2_buffer_head, (gdb) 60 if (bh->b_count) { (gdb) 61 osi_list_del(&bh->b_list); (gdb) 62 osi_list_add(&bh->b_list, &sdp->buf_list); (gdb) 63 continue; (gdb) 57 while (sdp->num_bufs * sdp->bsize > 128 << 20) { (gdb) print sdp->num_bufs $6 = 32769 Version-Release number of selected component (if applicable): gfs2-utils-0.1.49-1.el5 How reproducible: unknown, probably easily. Steps to Reproduce: 1. mkfs -t gfs 2. mount; umount 3. gfs2_convert Actual results: See above Expected results: gfs2_convert shouldn't eat up 100% of a CPU. Additional info:
I already found and this bug while working on bug #471618. A patch to fix the problem is already attached to that bugzilla. The question is only whether to use this bugzilla to implement the patch or to wait until I'm finished with that one. I was going to add it to the other bugzilla record, but now that this record is open, I think I'm inclined to use this one instead. That way the separate problems will treated separately. At this point it's a matter of paperwork and ack flags. Opinions encouraged.
Folding this into 471618. *** This bug has been marked as a duplicate of bug 471618 ***