Commit c2589282 authored by Andreas Gruenbacher's avatar Andreas Gruenbacher

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: default avatarAndreas Gruenbacher <agruenba@redhat.com>
Reviewed-by: default avatarBob Peterson <rpeterso@redhat.com>
parent 4a772772
......@@ -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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment