diff mbox

tcmu_rbd_open 'size' is expected to be signed

Message ID 20170503205007.21976-2-dab21774@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

David Butterfield May 3, 2017, 8:50 p.m. UTC
tcmu_rbd_open 'size' is expected to be signed, as evidenced by
the check "if (size < 0)" later in the function.

Signed-off-by: David Butterfield <dab21774@gmail.com>
---
 rbd.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Mike Christie May 3, 2017, 11:58 p.m. UTC | #1
On 05/03/2017 03:50 PM, David Butterfield wrote:
> tcmu_rbd_open 'size' is expected to be signed, as evidenced by
> the check "if (size < 0)" later in the function.
> 
> Signed-off-by: David Butterfield <dab21774@gmail.com>
> ---
>  rbd.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/rbd.c b/rbd.c
> index efd001f..ed50aa5 100644
> --- a/rbd.c
> +++ b/rbd.c
> @@ -384,7 +384,8 @@ static int tcmu_rbd_open(struct tcmu_device *dev)
>  	char *pool, *name;
>  	char *config;
>  	struct tcmu_rbd_state *state;
> -	uint64_t size, rbd_size;
> +	uint64_t rbd_size;
> +	ssize_t size;
>  	int ret, block_size;
>  
>  	state = calloc(1, sizeof(*state));

Can we just make it a int64_t to match the other handlers?

I will fix qcow.c.
--
To unsubscribe from this list: send the line "unsubscribe target-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/rbd.c b/rbd.c
index efd001f..ed50aa5 100644
--- a/rbd.c
+++ b/rbd.c
@@ -384,7 +384,8 @@  static int tcmu_rbd_open(struct tcmu_device *dev)
 	char *pool, *name;
 	char *config;
 	struct tcmu_rbd_state *state;
-	uint64_t size, rbd_size;
+	uint64_t rbd_size;
+	ssize_t size;
 	int ret, block_size;
 
 	state = calloc(1, sizeof(*state));