]> www.infradead.org Git - users/jedix/linux-maple.git/commit
xfs: fix xfs_error_get_cfg for negative errnos
authorEric Sandeen <sandeen@redhat.com>
Wed, 20 Jul 2016 00:48:51 +0000 (10:48 +1000)
committerChuck Anderson <chuck.anderson@oracle.com>
Sat, 10 Jun 2017 00:25:18 +0000 (17:25 -0700)
commite17a1808c64f5bf257d2069abebec15030cda2e8
treebcae7b1a293cb8318e060633d19de6b6f3e9e81d
parentecd3fa9cf087a9b9546faa5a6b5ae2a5a4a28bc8
xfs: fix xfs_error_get_cfg for negative errnos

xfs_error_get_cfg() is called with bp->b_error as an arg, which is
negative, so the switch statement won't ever find any matches.

This results in only the default error handler having any effect, as
EIO/ENOSPC/ENODEV get ignored due to the wrong sign.

It seems simplest to always flip the error sign to positive, so that
we can handle either negative errors in bp->b_error, or possibly a
positive errno via something like xfs_error_get_cfg(EIO) - this
future-proofs the function.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
(cherry picked from commit e97f6c545f963abd7de56a58a29ba73a9edee015)

Orabug: 26130728

Signed-off-by: Kirtikar Kashyap <kirtikar.kashyap@oracle.com>
Reviewed-by: Jack Vogel <jack.vogel@oracle.com>
fs/xfs/xfs_sysfs.c