[Open-FCoE] [PATCH v3 09/10] libfcoe: Handle ERESTARTSYS for fcoe transport

Yi Zou yi.zou at intel.com
Thu Jan 13 02:20:36 UTC 2011


From: Bhanu Gollapudi <bprakash at broadcom.com>

When the LLDDs return ERESTARTSYS as a result of not succeeding
rtnl_trylock(), fcoe_transport_* functions should return
restart_syscall().

Signed-off-by: Bhanu Prakash Gollapudi <bprakash at broadcom.com>
Signed-off-by: Yi Zou <yi.zou at intel.com>
---

 drivers/scsi/fcoe/fcoe_transport.c |   21 +++++++++++++++++----
 1 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/drivers/scsi/fcoe/fcoe_transport.c b/drivers/scsi/fcoe/fcoe_transport.c
index 8a630aa..95fe16b 100644
--- a/drivers/scsi/fcoe/fcoe_transport.c
+++ b/drivers/scsi/fcoe/fcoe_transport.c
@@ -360,7 +360,10 @@ out_nodev:
 		(rc) ? "failed" : "succeeded",
 		(netdev) ? netdev->name : "n/a");
 
-	return rc;
+	if (rc == -ERESTARTSYS)
+		return restart_syscall();
+	else
+		return rc;
 }
 
 /**
@@ -420,7 +423,10 @@ out_nodev:
 		(rc) ? "failed" : "succeeded",
 		(netdev) ? netdev->name : "n/a");
 
-	return rc;
+	if (rc == -ERESTARTSYS)
+		return restart_syscall();
+	else
+		return rc;
 }
 
 /**
@@ -472,7 +478,11 @@ out_putdev:
 	dev_put(netdev);
 out_nodev:
 	mutex_unlock(&ft_mutex);
-	return rc;
+
+	if (rc == -ERESTARTSYS)
+		return restart_syscall();
+	else
+		return rc;
 }
 
 /**
@@ -524,7 +534,10 @@ out_putdev:
 	dev_put(netdev);
 out_nodev:
 	mutex_unlock(&ft_mutex);
-	return rc;
+	if (rc == -ERESTARTSYS)
+		return restart_syscall();
+	else
+		return rc;
 }
 
 /**




More information about the devel mailing list