diff options
author | Darrick J. Wong <darrick.wong@oracle.com> | 2019-11-07 18:28:18 +0300 |
---|---|---|
committer | Darrick J. Wong <darrick.wong@oracle.com> | 2019-11-08 18:44:12 +0300 |
commit | 2b91b28e29f6491efbe77694c17465a3054f37cf (patch) | |
tree | 415c08553a18e3645e3bf6de6f6997d9d02d4184 /fs/iomap/fiemap.c | |
parent | add66fcbd3fbe5aa0dd4dddfa23e119c12989a27 (diff) | |
download | linux-2b91b28e29f6491efbe77694c17465a3054f37cf.tar.xz |
iomap: iomap_bmap should check iomap_apply return value
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>
Diffstat (limited to 'fs/iomap/fiemap.c')
-rw-r--r-- | fs/iomap/fiemap.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/iomap/fiemap.c b/fs/iomap/fiemap.c index 690ef2d7c6c8..bccf305ea9ce 100644 --- 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); |