mirror of
https://github.com/team-infusion-developers/android_kernel_samsung_msm8976.git
synced 2024-09-21 11:53:01 +00:00
xfs: fix segment in xfs_buf_item_format_segment
Not every segment in a multi-segment buffer is dirty in a transaction and they will not be outputted. The assert in xfs_buf_item_format_segment() that checks for the at least one chunk of data in the segment to be used is not necessary true for multi-segmented buffers. Signed-off-by: Mark Tinguely <tinguely@sgi.com> Reviewed-by: Dave Chinner <dchinner@redhat.com> Signed-off-by: Ben Myers <bpm@sgi.com>
This commit is contained in:
parent
0f22f9d0cd
commit
2d0e9df579
|
@ -287,6 +287,17 @@ xfs_buf_item_format_segment(
|
||||||
*/
|
*/
|
||||||
base_size = offsetof(struct xfs_buf_log_format, blf_data_map) +
|
base_size = offsetof(struct xfs_buf_log_format, blf_data_map) +
|
||||||
(blfp->blf_map_size * sizeof(blfp->blf_data_map[0]));
|
(blfp->blf_map_size * sizeof(blfp->blf_data_map[0]));
|
||||||
|
|
||||||
|
nvecs = 0;
|
||||||
|
first_bit = xfs_next_bit(blfp->blf_data_map, blfp->blf_map_size, 0);
|
||||||
|
if (!(bip->bli_flags & XFS_BLI_STALE) && first_bit == -1) {
|
||||||
|
/*
|
||||||
|
* If the map is not be dirty in the transaction, mark
|
||||||
|
* the size as zero and do not advance the vector pointer.
|
||||||
|
*/
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
vecp->i_addr = blfp;
|
vecp->i_addr = blfp;
|
||||||
vecp->i_len = base_size;
|
vecp->i_len = base_size;
|
||||||
vecp->i_type = XLOG_REG_TYPE_BFORMAT;
|
vecp->i_type = XLOG_REG_TYPE_BFORMAT;
|
||||||
|
@ -301,15 +312,13 @@ xfs_buf_item_format_segment(
|
||||||
*/
|
*/
|
||||||
trace_xfs_buf_item_format_stale(bip);
|
trace_xfs_buf_item_format_stale(bip);
|
||||||
ASSERT(blfp->blf_flags & XFS_BLF_CANCEL);
|
ASSERT(blfp->blf_flags & XFS_BLF_CANCEL);
|
||||||
blfp->blf_size = nvecs;
|
goto out;
|
||||||
return vecp;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Fill in an iovec for each set of contiguous chunks.
|
* Fill in an iovec for each set of contiguous chunks.
|
||||||
*/
|
*/
|
||||||
first_bit = xfs_next_bit(blfp->blf_data_map, blfp->blf_map_size, 0);
|
|
||||||
ASSERT(first_bit != -1);
|
|
||||||
last_bit = first_bit;
|
last_bit = first_bit;
|
||||||
nbits = 1;
|
nbits = 1;
|
||||||
for (;;) {
|
for (;;) {
|
||||||
|
@ -371,7 +380,8 @@ xfs_buf_item_format_segment(
|
||||||
nbits++;
|
nbits++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
bip->__bli_format.blf_size = nvecs;
|
out:
|
||||||
|
blfp->blf_size = nvecs;
|
||||||
return vecp;
|
return vecp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue