kern/182214: vop_stdfsync() incorrectly retries too many times

dennis chang dchang at panasas.com
Wed Sep 18 20:40:00 UTC 2013


>Number:         182214
>Category:       kern
>Synopsis:       vop_stdfsync() incorrectly retries too many times
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Sep 18 20:40:00 UTC 2013
>Closed-Date:
>Last-Modified:
>Originator:     dennis chang
>Release:        7.2 and 10
>Organization:
panasas
>Environment:
>Description:
  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         }
>How-To-Repeat:

>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         }

>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list