* [bug report] dm: add emulated block size target
@ 2020-04-29 13:21 Dan Carpenter
2020-04-29 15:09 ` Heinz Mauelshagen
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2020-04-29 13:21 UTC (permalink / raw)
To: heinzm; +Cc: dm-devel
Hello Heinz Mauelshagen,
The patch d3d11ad3d087: "dm: add emulated block size target" from Mar
9, 2020, leads to the following static checker warning:
drivers/md/dm-ebs-target.c:190 __ebs_process_bios()
warn: assigning signed to unsigned: 'bio->bi_status = r' '(-4095)-0'
drivers/md/dm-ebs-target.c
173 if (__block_mod(bio_end_sector(bio), ec->u_bs) && block2 != block1)
174 dm_bufio_prefetch(ec->bufio, block2, 1);
175 }
176 }
177
178 bio_list_for_each(bio, &bios) {
179 r = -EIO;
180 if (bio_op(bio) == REQ_OP_READ)
181 r = __ebs_rw_bio(ec, READ, bio);
182 else if (bio_op(bio) == REQ_OP_WRITE) {
183 write = true;
184 r = __ebs_rw_bio(ec, WRITE, bio);
185 } else if (bio_op(bio) == REQ_OP_DISCARD) {
186 /* FIXME: (optionally) call dm_bufio_discard_buffers() once upstream. */
187 r = __ebs_forget_bio(ec, bio);
188 }
189
190 bio->bi_status = r;
^^^^^^^^^^^^^^^^^^
"r" is a negative error code and ->bi_status is a u8 so this won't work.
191 }
192
193 /*
194 * We write dirty buffers after processing I/O on them
195 * but before we endio thus addressing REQ_FUA/REQ_SYNC.
196 */
197 r = write ? dm_bufio_write_dirty_buffers(ec->bufio) : 0;
regards,
dan carpenter
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [bug report] dm: add emulated block size target
2020-04-29 13:21 [bug report] dm: add emulated block size target Dan Carpenter
@ 2020-04-29 15:09 ` Heinz Mauelshagen
0 siblings, 0 replies; 2+ messages in thread
From: Heinz Mauelshagen @ 2020-04-29 15:09 UTC (permalink / raw)
To: Dan Carpenter; +Cc: dm-devel
Thanks for reporting this.
See patch to fix this submitted to dm-devel.
Heinz
On 4/29/20 3:21 PM, Dan Carpenter wrote:
> Hello Heinz Mauelshagen,
>
> The patch d3d11ad3d087: "dm: add emulated block size target" from Mar
> 9, 2020, leads to the following static checker warning:
>
> drivers/md/dm-ebs-target.c:190 __ebs_process_bios()
> warn: assigning signed to unsigned: 'bio->bi_status = r' '(-4095)-0'
>
> drivers/md/dm-ebs-target.c
> 173 if (__block_mod(bio_end_sector(bio), ec->u_bs) && block2 != block1)
> 174 dm_bufio_prefetch(ec->bufio, block2, 1);
> 175 }
> 176 }
> 177
> 178 bio_list_for_each(bio, &bios) {
> 179 r = -EIO;
> 180 if (bio_op(bio) == REQ_OP_READ)
> 181 r = __ebs_rw_bio(ec, READ, bio);
> 182 else if (bio_op(bio) == REQ_OP_WRITE) {
> 183 write = true;
> 184 r = __ebs_rw_bio(ec, WRITE, bio);
> 185 } else if (bio_op(bio) == REQ_OP_DISCARD) {
> 186 /* FIXME: (optionally) call dm_bufio_discard_buffers() once upstream. */
> 187 r = __ebs_forget_bio(ec, bio);
> 188 }
> 189
> 190 bio->bi_status = r;
> ^^^^^^^^^^^^^^^^^^
> "r" is a negative error code and ->bi_status is a u8 so this won't work.
>
> 191 }
> 192
> 193 /*
> 194 * We write dirty buffers after processing I/O on them
> 195 * but before we endio thus addressing REQ_FUA/REQ_SYNC.
> 196 */
> 197 r = write ? dm_bufio_write_dirty_buffers(ec->bufio) : 0;
>
> regards,
> dan carpenter
>
>
> --
> dm-devel mailing list
> dm-devel@redhat.com
> https://www.redhat.com/mailman/listinfo/dm-devel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-04-29 15:09 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-04-29 13:21 [bug report] dm: add emulated block size target Dan Carpenter
2020-04-29 15:09 ` Heinz Mauelshagen
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.