cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
From: Andreas Gruenbacher <agruenba@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [PATCH 1/3] gfs2: fallocate_chunk: Always initialize struct iomap
Date: Sat,  7 Jul 2018 11:39:02 +0200	[thread overview]
Message-ID: <20180707093904.23177-2-agruenba@redhat.com> (raw)
In-Reply-To: <20180707093904.23177-1-agruenba@redhat.com>

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 <agruenba@redhat.com>
---
 fs/gfs2/file.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

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)
-- 
2.17.1



  reply	other threads:[~2018-07-07  9:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-07  9:39 [Cluster-devel] [PATCH 0/3] gfs2: More iomap enablement Andreas Gruenbacher
2018-07-07  9:39 ` Andreas Gruenbacher [this message]
2018-07-07  9:39 ` [Cluster-devel] [PATCH 2/3] gfs2: Use iomap for stuffed direct I/O reads Andreas Gruenbacher
2018-07-07  9:39 ` [Cluster-devel] [PATCH 3/3] gfs2: use iomap_readpage for blocksize == PAGE_SIZE Andreas Gruenbacher
2018-07-09 12:47 ` [Cluster-devel] [PATCH 0/3] gfs2: More iomap enablement Bob Peterson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180707093904.23177-2-agruenba@redhat.com \
    --to=agruenba@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).