projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
add66fc
)
iomap: iomap_bmap should check iomap_apply return value
author
Darrick J. Wong
<darrick.wong@oracle.com>
Thu, 7 Nov 2019 15:28:18 +0000
(07:28 -0800)
committer
Darrick J. Wong
<darrick.wong@oracle.com>
Fri, 8 Nov 2019 15:44:12 +0000
(07:44 -0800)
Coverity caught this fairly minor bug, but we should check the return
value of iomap_apply regardless.
Coverity-id:
1437065
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
fs/iomap/fiemap.c
patch
|
blob
|
history
diff --git
a/fs/iomap/fiemap.c
b/fs/iomap/fiemap.c
index 690ef2d7c6c803e802dc4f992eb4687e5994ddd7..bccf305ea9ce26d1f34ac9f10157af448c1f3174 100644
(file)
--- a/
fs/iomap/fiemap.c
+++ b/
fs/iomap/fiemap.c
@@
-133,12
+133,16
@@
iomap_bmap(struct address_space *mapping, sector_t bno,
struct inode *inode = mapping->host;
loff_t pos = bno << inode->i_blkbits;
unsigned blocksize = i_blocksize(inode);
+ int ret;
if (filemap_write_and_wait(mapping))
return 0;
bno = 0;
- iomap_apply(inode, pos, blocksize, 0, ops, &bno, iomap_bmap_actor);
+ ret = iomap_apply(inode, pos, blocksize, 0, ops, &bno,
+ iomap_bmap_actor);
+ if (ret)
+ return 0;
return bno;
}
EXPORT_SYMBOL_GPL(iomap_bmap);