[linux,dev-4.10] drivers (fsi): occ: Change errno for releasing client during transfer

Message ID 1509471272-30457-1-git-send-email-eajames@linux.vnet.ibm.com
State New
Headers show
Series
  • [linux,dev-4.10] drivers (fsi): occ: Change errno for releasing client during transfer
Related show

Commit Message

Eddie James Oct. 31, 2017, 5:34 p.m.
From: "Edward A. James" <eajames@us.ibm.com>

Clients were receiving the ECANCELED errno when the client is removed
during a transfer. Use ENODEV instead, as ECANCELED is for AIO ops.

Signed-off-by: Edward A. James <eajames@us.ibm.com>
---
 drivers/fsi/occ.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Christopher Bostic Oct. 31, 2017, 9:03 p.m. | #1
Reviewed-by: Christopher Bostic <cbostic@linux.vnet.ibm.com>


On 10/31/17 12:34 PM, Eddie James wrote:
> From: "Edward A. James" <eajames@us.ibm.com>
>
> Clients were receiving the ECANCELED errno when the client is removed
> during a transfer. Use ENODEV instead, as ECANCELED is for AIO ops.
>
> Signed-off-by: Edward A. James <eajames@us.ibm.com>
> ---
>   drivers/fsi/occ.c | 4 +---
>   1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/fsi/occ.c b/drivers/fsi/occ.c
> index 1fe1a54..adc64f3 100644
> --- a/drivers/fsi/occ.c
> +++ b/drivers/fsi/occ.c
> @@ -240,9 +240,7 @@ static ssize_t occ_read_common(struct occ_client *client, char __user *ubuf,
>   		spin_lock_irq(&client->lock);
>
>   		if (!test_bit(XFR_COMPLETE, &xfr->flags)) {
> -			if (test_bit(XFR_CANCELED, &xfr->flags))
> -				rc = -ECANCELED;
> -			else if (occ->cancel)
> +			if (occ->cancel || test_bit(XFR_CANCELED, &xfr->flags))
>   				rc = -ENODEV;
>   			else
>   				rc = -EINTR;
Andrew Jeffery Nov. 1, 2017, 7:35 a.m. | #2
On Tue, 2017-10-31 at 12:34 -0500, Eddie James wrote:
> From: "Edward A. James" <eajames@us.ibm.com>

> Clients were receiving the ECANCELED errno when the client is removed
> during a transfer. Use ENODEV instead, as ECANCELED is for AIO ops.

> Signed-off-by: Edward A. James <eajames@us.ibm.com>

Applied to dev-4.10.

Andrew

Patch

diff --git a/drivers/fsi/occ.c b/drivers/fsi/occ.c
index 1fe1a54..adc64f3 100644
--- a/drivers/fsi/occ.c
+++ b/drivers/fsi/occ.c
@@ -240,9 +240,7 @@  static ssize_t occ_read_common(struct occ_client *client, char __user *ubuf,
 		spin_lock_irq(&client->lock);
 
 		if (!test_bit(XFR_COMPLETE, &xfr->flags)) {
-			if (test_bit(XFR_CANCELED, &xfr->flags))
-				rc = -ECANCELED;
-			else if (occ->cancel)
+			if (occ->cancel || test_bit(XFR_CANCELED, &xfr->flags))
 				rc = -ENODEV;
 			else
 				rc = -EINTR;