qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] overflow of int ret: use ssize_t for ret


From: Stefan Priebe - Profihost AG
Subject: Re: [Qemu-devel] [PATCH] overflow of int ret: use ssize_t for ret
Date: Thu, 22 Nov 2012 20:09:32 +0100
User-agent: Mozilla/5.0 (Windows NT 6.0; rv:12.0) Gecko/20120428 Thunderbird/12.0.1

Hi Andreas,

thanks for your comment. Do i have to resend this patch?

--
Greets,
Stefan

Am 22.11.2012 17:40, schrieb Andreas Färber:
Am 22.11.2012 10:07, schrieb Stefan Priebe:
When acb->cmd is WRITE or DISCARD block/rbd stores rcb->size into acb->ret

Look here:
    if (acb->cmd == RBD_AIO_WRITE ||
         acb->cmd == RBD_AIO_DISCARD) {
         if (r<  0) {
             acb->ret = r;
             acb->error = 1;
         } else if (!acb->error) {
             acb->ret = rcb->size;
         }

right now acb->ret is just an int and we might get an overflow if size is too 
big.
For discards rcb->size holds the size of the discard - this might be some TB if 
you
discard a whole device.

The steps to reproduce are:
mkfs.xfs -f a whole device bigger than int in bytes. mkfs.xfs sends a discard. 
Important is that you use scsi-hd and set discard_granularity=512. Otherwise 
rbd disabled discard support.

Whatever type you decide to use, please add an identifying topic such as
"block/rbd:" in the subject (int ret is very generic!), and this patch
is missing a Signed-off-by.

Regards,
Andreas





reply via email to

[Prev in Thread] Current Thread [Next in Thread]