Codebase list tcmu / 96302e5
Add patch to fix 32 bit builds with -Werror Closes: #946460 Thanks: James Page <james.page@ubuntu.com> Raphaƫl Hertzog 4 years ago
2 changed file(s) with 20 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
0 Description: Case return of tcmu_lba_to_byte to size_t
1 Ensures comparison of size_t types avoiding compilation
2 error under 32 bit architectures.
3 Author: James Page <james.page@ubuntu.com>
4 Forwarded: https://github.com/open-iscsi/tcmu-runner/pull/603
5
6 diff --git a/tcmur_cmd_handler.c b/tcmur_cmd_handler.c
7 index 132c668..a68e367 100644
8 --- a/tcmur_cmd_handler.c
9 +++ b/tcmur_cmd_handler.c
10 @@ -725,7 +725,7 @@ static int handle_writesame(struct tcmu_device *dev, struct tcmulib_cmd *cmd)
11
12 max_xfer_length = tcmu_dev_get_max_xfer_len(dev) * block_size;
13 length = round_up(length, max_xfer_length);
14 - length = min(length, tcmu_lba_to_byte(dev, lba_cnt));
15 + length = min(length, (size_t)tcmu_lba_to_byte(dev, lba_cnt));
16
17 if (tcmur_cmd_state_init(tcmur_cmd, sizeof(*write_same), length)) {
18 tcmu_dev_err(dev, "Failed to calloc write_same data!\n");
00 Disable-Werror.patch
1 32bit-size_t-cast.patch