Commit 2b91b28e authored by Darrick J. Wong's avatar Darrick J. Wong

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: default avatarDarrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
parent add66fcb
...@@ -133,12 +133,16 @@ iomap_bmap(struct address_space *mapping, sector_t bno, ...@@ -133,12 +133,16 @@ iomap_bmap(struct address_space *mapping, sector_t bno,
struct inode *inode = mapping->host; struct inode *inode = mapping->host;
loff_t pos = bno << inode->i_blkbits; loff_t pos = bno << inode->i_blkbits;
unsigned blocksize = i_blocksize(inode); unsigned blocksize = i_blocksize(inode);
int ret;
if (filemap_write_and_wait(mapping)) if (filemap_write_and_wait(mapping))
return 0; return 0;
bno = 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; return bno;
} }
EXPORT_SYMBOL_GPL(iomap_bmap); EXPORT_SYMBOL_GPL(iomap_bmap);
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment