From: Andreas Gruenbacher Date: Fri, 6 Jul 2018 22:05:41 +0000 (+0100) Subject: gfs2: fallocate_chunk: Always initialize struct iomap X-Git-Tag: v4.19-rc1~128^2~10 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=c25892827c7996eb19ca2a5b1cf596218122e994;p=linux.git gfs2: fallocate_chunk: Always initialize struct iomap In fallocate_chunk, always initialize the iomap before calling gfs2_iomap_get_alloc: future changes could otherwise cause things like iomap.flags to leak across calls. Signed-off-by: Andreas Gruenbacher Reviewed-by: Bob Peterson --- diff --git a/fs/gfs2/file.c b/fs/gfs2/file.c index f3c6d78659b1..6d895d39158a 100644 --- a/fs/gfs2/file.c +++ b/fs/gfs2/file.c @@ -877,7 +877,6 @@ static int fallocate_chunk(struct inode *inode, loff_t offset, loff_t len, struct gfs2_inode *ip = GFS2_I(inode); loff_t end = offset + len; struct buffer_head *dibh; - struct iomap iomap = { }; int error; error = gfs2_meta_inode_buffer(ip, &dibh); @@ -893,6 +892,8 @@ static int fallocate_chunk(struct inode *inode, loff_t offset, loff_t len, } while (offset < end) { + struct iomap iomap = { }; + error = gfs2_iomap_get_alloc(inode, offset, end - offset, &iomap); if (error)