Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c2589282 authored by Andreas Gruenbacher's avatar Andreas Gruenbacher
Browse files

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
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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)