687 /* 688 * If synchronous the caller expects us to completely resolve all 689 * dirty buffers in the system. Wait for in-progress I/O to 690 * complete (which could include background bitmap writes), then 691 * retry if dirty blocks still exist. 692 */ 693 if (ap->a_waitfor == MNT_WAIT) { 694 bufobj_wwait(bo, 0, 0); 695 if (bo->bo_dirty.bv_cnt > 0) { 696 /* 697 * If we are unable to write any of these buffers 698 * then we fail now rather than trying endlessly 699 * to write them out. 700 */ 701 TAILQ_FOREACH(bp, &bo->bo_dirty.bv_hd, b_bobufs) 702 if ((error = bp->b_error) == 0) ---> error is constantly overwritten. It should bail out when any buffer has an error. 703 continue; 704 if (error == 0 && --maxretry >= 0) ----> error is from the last buffer, instead of any buffer. 705 goto loop1; 706 error = EAGAIN; 707 } 708 } Fix: 687 /* 688 * If synchronous the caller expects us to completely resolve all 689 * dirty buffers in the system. Wait for in-progress I/O to 690 * complete (which could include background bitmap writes), then 691 * retry if dirty blocks still exist. 692 */ 693 if (ap->a_waitfor == MNT_WAIT) { 694 bufobj_wwait(bo, 0, 0); 695 if (bo->bo_dirty.bv_cnt > 0) { 696 /* 697 * If we are unable to write any of these buffers 698 * then we fail now rather than trying endlessly 699 * to write them out. 700 */ 701 TAILQ_FOREACH(bp, &bo->bo_dirty.bv_hd, b_bobufs) { 702 if (bp->b_error) 703 error = b_error; break; } } 704 if (error == 0 && --maxretry >= 0) 705 goto loop1; 706 error = EAGAIN; 707 } 708 }
For bugs matching the following criteria: Status: In Progress Changed: (is less than) 2014-06-01 Reset to default assignee and clear in-progress tags. Mail being skipped