aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarrick J. Wong <darrick.wong@oracle.com>2018-08-10 20:55:57 -0400
committerDarrick J. Wong <darrick.wong@oracle.com>2018-08-14 11:17:02 -0400
commit7d5e049e72c4cb933b557c78cbd63285dd8102ce (patch)
tree930a949a173a777ff2ec2bf1a1c36ca07ff56bee
parent1fc25f51d7c18e07e8cf935cbdd4603adfc7b3ad (diff)
iomap: fix WARN_ON_ONCE on uninitialized variable
In commit 9dc55f1389f9569 ("iomap: add support for sub-pagesize buffered I/O without buffer heads") we moved the initialization of poff (it's computed from pos) into a separate helper function. Inline data only ever deals with pos == 0, hence the WARN_ON_ONCE, but now we're testing an uninitialized variable. Therefore, change the test to check the parameter directly. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Reviewed-by: Allison Henderson <allison.henderson@oracle.com> Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
-rw-r--r--fs/iomap.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/iomap.c b/fs/iomap.c
index 8bd54c08deee..8a18163dc432 100644
--- a/fs/iomap.c
+++ b/fs/iomap.c
@@ -290,7 +290,7 @@ iomap_readpage_actor(struct inode *inode, loff_t pos, loff_t length, void *data,
290 sector_t sector; 290 sector_t sector;
291 291
292 if (iomap->type == IOMAP_INLINE) { 292 if (iomap->type == IOMAP_INLINE) {
293 WARN_ON_ONCE(poff); 293 WARN_ON_ONCE(pos);
294 iomap_read_inline_data(inode, page, iomap); 294 iomap_read_inline_data(inode, page, iomap);
295 return PAGE_SIZE; 295 return PAGE_SIZE;
296 } 296 }