Skip to contentSkip to conversation

drivers (fsi): occ: Change errno for releasing client during transfer

PATCH Applied Eddie James 3 participants 3 messages Oct 31, 2017 – Nov 1, 2017 FSI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drivers (fsi): occ: Change errno for releasing client during transfer

From: "Edward A. James" <[email protected]>

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

---
 drivers/fsi/occ.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/fsi/occ.c +1 -3
index 1fe1a54..adc64f3 100644
@@ -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;
Signature · 1 line
1.8.3.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 25 lines · Eddie James

From: "Edward A. James" <[email protected]>

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

---
  drivers/fsi/occ.c | 4 +---
  1 file changed, 1 insertion(+), 3 deletions(-)
drivers/fsi/occ.c +1 -3
index 1fe1a54..adc64f3 100644
@@ -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;