Whamcloud - gitweb
LU-11610 target: Fix correct return value in out_handler.c 60/56260/5
authorRonnie Sahlberg <rsahlberg@whamcloud.com>
Wed, 4 Sep 2024 04:48:48 +0000 (00:48 -0400)
committerOleg Drokin <green@whamcloud.com>
Mon, 2 Dec 2024 05:40:32 +0000 (05:40 +0000)
commit371c0c1aef0acd46ba7c16cf4f2e05a21ae48fdf
tree8511cbd3be329e197f7f803fc9daa031011d5ccc
parent1ccc52da7414574c215d330e796875f34bb78110
LU-11610 target: Fix correct return value in out_handler.c

out_handler.c has a pattern:

    if (IS_ERR(x) || expression) {
        ...
        RETURN(PTR_ERR(x))
    }

which if x is a valid pointer but the expression that represents an
error would cause the function to return PTR_ERR(x) for a valid pointer.
Fix this by either returning PTR_ERR(x) or -EPROTO depending on what the error
is.

Signed-off-by: Ronnie Sahlberg <rsahlberg@whamcloud.com>
Change-Id: Ic9f3427be31a9ba84b46f349ba90cc6aea379845
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/56260
Reviewed-by: Li Dongyang <dongyangli@ddn.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Timothy Day <timday@amazon.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
lustre/target/out_handler.c