diff options
Diffstat (limited to 'fs/gfs2/lops.c')
-rw-r--r-- | fs/gfs2/lops.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/gfs2/lops.c b/fs/gfs2/lops.c index aff70f0698fd..3b395c41b2f3 100644 --- a/fs/gfs2/lops.c +++ b/fs/gfs2/lops.c | |||
@@ -486,8 +486,8 @@ static void databuf_lo_add(struct gfs2_sbd *sdp, struct gfs2_log_element *le) | |||
486 | gfs2_pin(sdp, bd->bd_bh); | 486 | gfs2_pin(sdp, bd->bd_bh); |
487 | tr->tr_num_databuf_new++; | 487 | tr->tr_num_databuf_new++; |
488 | } | 488 | } |
489 | sdp->sd_log_num_databuf++; | ||
490 | gfs2_log_lock(sdp); | 489 | gfs2_log_lock(sdp); |
490 | sdp->sd_log_num_databuf++; | ||
491 | list_add(&le->le_list, &sdp->sd_log_le_databuf); | 491 | list_add(&le->le_list, &sdp->sd_log_le_databuf); |
492 | gfs2_log_unlock(sdp); | 492 | gfs2_log_unlock(sdp); |
493 | } | 493 | } |
@@ -523,7 +523,7 @@ static void databuf_lo_before_commit(struct gfs2_sbd *sdp) | |||
523 | struct buffer_head *bh = NULL,*bh1 = NULL; | 523 | struct buffer_head *bh = NULL,*bh1 = NULL; |
524 | struct gfs2_log_descriptor *ld; | 524 | struct gfs2_log_descriptor *ld; |
525 | unsigned int limit; | 525 | unsigned int limit; |
526 | unsigned int total_dbuf = sdp->sd_log_num_databuf; | 526 | unsigned int total_dbuf; |
527 | unsigned int total_jdata = sdp->sd_log_num_jdata; | 527 | unsigned int total_jdata = sdp->sd_log_num_jdata; |
528 | unsigned int num, n; | 528 | unsigned int num, n; |
529 | __be64 *ptr = NULL; | 529 | __be64 *ptr = NULL; |
@@ -535,6 +535,7 @@ static void databuf_lo_before_commit(struct gfs2_sbd *sdp) | |||
535 | * into the log along with a header | 535 | * into the log along with a header |
536 | */ | 536 | */ |
537 | gfs2_log_lock(sdp); | 537 | gfs2_log_lock(sdp); |
538 | total_dbuf = sdp->sd_log_num_databuf; | ||
538 | bd2 = bd1 = list_prepare_entry(bd1, &sdp->sd_log_le_databuf, | 539 | bd2 = bd1 = list_prepare_entry(bd1, &sdp->sd_log_le_databuf, |
539 | bd_le.le_list); | 540 | bd_le.le_list); |
540 | while(total_dbuf) { | 541 | while(total_dbuf) { |
@@ -653,6 +654,7 @@ static void databuf_lo_before_commit(struct gfs2_sbd *sdp) | |||
653 | break; | 654 | break; |
654 | } | 655 | } |
655 | bh = NULL; | 656 | bh = NULL; |
657 | BUG_ON(total_dbuf < num); | ||
656 | total_dbuf -= num; | 658 | total_dbuf -= num; |
657 | total_jdata -= num; | 659 | total_jdata -= num; |
658 | } | 660 | } |