diff options
author | Christophe JAILLET | 2019-02-04 17:54:20 +0100 |
---|---|---|
committer | Greg Kroah-Hartman | 2019-02-12 19:47:20 +0100 |
commit | b6095cbd7841fff310c1ad135ae2c7da14df9da4 (patch) | |
tree | e30939ff6ad23e81b3a95a1b3a06de2b91a183f8 /fs/xfs | |
parent | xfs: cancel COW blocks before swapext (diff) | |
download | kernel-qcow2-linux-b6095cbd7841fff310c1ad135ae2c7da14df9da4.tar.gz kernel-qcow2-linux-b6095cbd7841fff310c1ad135ae2c7da14df9da4.tar.xz kernel-qcow2-linux-b6095cbd7841fff310c1ad135ae2c7da14df9da4.zip |
xfs: Fix error code in 'xfs_ioc_getbmap()'
commit 132bf6723749f7219c399831eeb286dbbb985429 upstream.
In this function, once 'buf' has been allocated, we unconditionally
return 0.
However, 'error' is set to some error codes in several error handling
paths.
Before commit 232b51948b99 ("xfs: simplify the xfs_getbmap interface")
this was not an issue because all error paths were returning directly,
but now that some cleanup at the end may be needed, we must propagate the
error code.
Fixes: 232b51948b99 ("xfs: simplify the xfs_getbmap interface")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'fs/xfs')
-rw-r--r-- | fs/xfs/xfs_ioctl.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/xfs/xfs_ioctl.c b/fs/xfs/xfs_ioctl.c index 0ef5ece5634c..bad90479ade2 100644 --- a/fs/xfs/xfs_ioctl.c +++ b/fs/xfs/xfs_ioctl.c @@ -1616,7 +1616,7 @@ xfs_ioc_getbmap( error = 0; out_free_buf: kmem_free(buf); - return 0; + return error; } struct getfsmap_info { |