From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Price Date: Thu, 17 Aug 2017 18:10:27 +0100 Subject: [Cluster-devel] [PATCH 2/2] gfs2_edit savemeta: Use size_t for saved structure lengths In-Reply-To: <20170817171027.8449-1-anprice@redhat.com> References: <20170817171027.8449-1-anprice@redhat.com> Message-ID: <20170817171027.8449-2-anprice@redhat.com> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Although the value range can fit in an int it's better to use an unsigned type consistent with sizeof and memcpy. Signed-off-by: Andrew Price --- gfs2/edit/savemeta.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gfs2/edit/savemeta.c b/gfs2/edit/savemeta.c index 6ae38274..7ff1b8e4 100644 --- a/gfs2/edit/savemeta.c +++ b/gfs2/edit/savemeta.c @@ -190,11 +190,11 @@ static const char *anthropomorphize(unsigned long long inhuman_value) return out_val; } -static int di_save_len(struct gfs2_buffer_head *bh, uint64_t owner) +static size_t di_save_len(struct gfs2_buffer_head *bh, uint64_t owner) { struct gfs2_inode *inode; struct gfs2_dinode *dn; - int len; + size_t len; if (sbd.gfs1) inode = lgfs2_gfs_inode_get(&sbd, bh); @@ -234,7 +234,7 @@ static int di_save_len(struct gfs2_buffer_head *bh, uint64_t owner) * -1 if this isn't gfs metadata. */ static int get_gfs_struct_info(struct gfs2_buffer_head *lbh, uint64_t owner, - int *block_type, int *gstruct_len) + int *block_type, size_t *gstruct_len) { struct gfs2_meta_header mh; @@ -423,8 +423,8 @@ static int savemetaclose(struct metafd *mfd) static int save_bh(struct metafd *mfd, struct gfs2_buffer_head *savebh, uint64_t owner, int *blktype) { struct saved_metablock *savedata; + size_t blklen; size_t outsz; - int blklen; /* If this isn't metadata and isn't a system file, we don't want it. Note that we're checking "owner" here rather than blk. That's -- 2.13.5