]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
xfs: add missing error check in xfs_prepare_shift()
authorBrian Foster <bfoster@redhat.com>
Fri, 26 Apr 2019 14:30:24 +0000 (07:30 -0700)
committerMarcelo Henrique Cerri <marcelo.cerri@canonical.com>
Fri, 17 Jan 2020 17:23:03 +0000 (14:23 -0300)
commitc1c6410473bf992bd5bd394d1bc327492a18baf1
tree7fbbf2841b4c709ce218946c8078a35fd7630af2
parentbfd3376f8cf153a38d5f02cd306a7f37f5872061
xfs: add missing error check in xfs_prepare_shift()

BugLink: https://bugs.launchpad.net/bugs/1857158
commit 1749d1ea89bdf3181328b7d846e609d5a0e53e50 upstream.

xfs_prepare_shift() fails to check the error return from
xfs_flush_unmap_range(). If the latter fails, that could lead to an
insert/collapse range operation over a delalloc range, which is not
supported.

Add an error check and return appropriately. This is reproduced
rarely by generic/475.

Fixes: 7f9f71be84bc ("xfs: extent shifting doesn't fully invalidate page cache")
Signed-off-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Allison Collins <allison.henderson@oracle.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Cc: Nobuhiro Iwamatsu <nobuhiro1.iwamatsu@toshiba.co.jp>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
fs/xfs/xfs_bmap_util.c