From: Wang Shilong Date: Fri, 11 Dec 2020 07:17:50 +0000 (+0800) Subject: LU-14205 osd-ldiskfs: return correct error after end io X-Git-Tag: 2.14.0-RC1~63 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=refs%2Fchanges%2F44%2F40944%2F2;p=fs%2Flustre-release.git LU-14205 osd-ldiskfs: return correct error after end io @bi_status could be positive in newer kernel, we need use blk_status_to_errno() helper to convert error properly. Otherwise, a positive value could be returned to client which might trigger unexpected error and make client fail to resend. Test-Parameters: clientdistro=el8.3 serverdistro=el8.3 Signed-off-by: Wang Shilong Change-Id: I2e8f257814eff311b72416788b7f6d9e37bad84a Reviewed-on: https://review.whamcloud.com/40944 Tested-by: jenkins Reviewed-by: Andreas Dilger Tested-by: Maloo Reviewed-by: James Nunez --- diff --git a/lustre/osd-ldiskfs/osd_io.c b/lustre/osd-ldiskfs/osd_io.c index 4e2c0e3..9d62bae 100644 --- a/lustre/osd-ldiskfs/osd_io.c +++ b/lustre/osd-ldiskfs/osd_io.c @@ -159,7 +159,7 @@ void osd_fini_iobuf(struct osd_device *d, struct osd_iobuf *iobuf) #ifdef HAVE_BIO_ENDIO_USES_ONE_ARG static void dio_complete_routine(struct bio *bio) { - int error = bio->bi_status; + int error = blk_status_to_errno(bio->bi_status); #else static void dio_complete_routine(struct bio *bio, int error) {