diff options
author | Mark Tinguely <tinguely@sgi.com> | 2012-12-04 18:18:05 -0500 |
---|---|---|
committer | Ben Myers <bpm@sgi.com> | 2012-12-17 17:28:14 -0500 |
commit | c883d0c400fc8cdbd5bbe71e179c9e64ace58e86 (patch) | |
tree | 9f96562f2c974996d6b7a2109fa7c28bd4690696 /fs/xfs/xfs_buf_item.c | |
parent | 820a554f2f83d21f7e9e608377c8c86af70917bd (diff) |
xfs: fix the multi-segment log buffer format
Per Dave Chinner suggestion, this patch:
1) Corrects the detection of whether a multi-segment buffer is
still tracking data.
2) Clears all the buffer log formats for a multi-segment buffer.
Signed-off-by: Mark Tinguely <tinguely@sgi.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_buf_item.c')
-rw-r--r-- | fs/xfs/xfs_buf_item.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/fs/xfs/xfs_buf_item.c b/fs/xfs/xfs_buf_item.c index c48e60bd857d..77b09750e92c 100644 --- a/fs/xfs/xfs_buf_item.c +++ b/fs/xfs/xfs_buf_item.c | |||
@@ -611,7 +611,7 @@ xfs_buf_item_unlock( | |||
611 | { | 611 | { |
612 | struct xfs_buf_log_item *bip = BUF_ITEM(lip); | 612 | struct xfs_buf_log_item *bip = BUF_ITEM(lip); |
613 | struct xfs_buf *bp = bip->bli_buf; | 613 | struct xfs_buf *bp = bip->bli_buf; |
614 | int aborted; | 614 | int aborted, clean, i; |
615 | uint hold; | 615 | uint hold; |
616 | 616 | ||
617 | /* Clear the buffer's association with this transaction. */ | 617 | /* Clear the buffer's association with this transaction. */ |
@@ -654,8 +654,15 @@ xfs_buf_item_unlock( | |||
654 | * If the buf item isn't tracking any data, free it, otherwise drop the | 654 | * If the buf item isn't tracking any data, free it, otherwise drop the |
655 | * reference we hold to it. | 655 | * reference we hold to it. |
656 | */ | 656 | */ |
657 | if (xfs_bitmap_empty(bip->__bli_format.blf_data_map, | 657 | clean = 1; |
658 | bip->__bli_format.blf_map_size)) | 658 | for (i = 0; i < bip->bli_format_count; i++) { |
659 | if (!xfs_bitmap_empty(bip->bli_formats[i].blf_data_map, | ||
660 | bip->bli_formats[i].blf_map_size)) { | ||
661 | clean = 0; | ||
662 | break; | ||
663 | } | ||
664 | } | ||
665 | if (clean) | ||
659 | xfs_buf_item_relse(bp); | 666 | xfs_buf_item_relse(bp); |
660 | else | 667 | else |
661 | atomic_dec(&bip->bli_refcount); | 668 | atomic_dec(&bip->bli_refcount); |