userlibandfileserver/fileserver/shostmassstorage/server/protocol/cscsiprotocol.cpp
changeset 44 36bfc973b146
parent 43 96e5fb8b040d
--- a/userlibandfileserver/fileserver/shostmassstorage/server/protocol/cscsiprotocol.cpp	Thu Dec 17 09:24:54 2009 +0200
+++ b/userlibandfileserver/fileserver/shostmassstorage/server/protocol/cscsiprotocol.cpp	Thu Jan 07 13:38:45 2010 +0200
@@ -260,7 +260,15 @@
 	TLba lastLba;
 	TUint32 blockLength;
 
-	TInt err = iSbcInterface->ReadCapacity10L(lastLba, blockLength);
+    // Retry ReadCapacity10L if stalled
+    TInt stallCounter = 4;
+    TInt err = KErrNone;
+    do
+        {
+        err = iSbcInterface->ReadCapacity10L(lastLba, blockLength);
+        } while (err == KErrCommandStalled && stallCounter-- > 0);
+
+
     if (err)
         {
         if (err == KErrCommandFailed)