Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/external/bsd/iscsi/dist/src/initiator Retry read capacity. D...
details: https://anonhg.NetBSD.org/src/rev/70c8e49671b7
branches: trunk
changeset: 762518:70c8e49671b7
user: sborrill <sborrill%NetBSD.org@localhost>
date: Tue Feb 22 13:04:31 2011 +0000
description:
Retry read capacity. Device may not be ready on first access, so need to
wait and re-issue. From Daisuke Aoyama (author of istgt).
diffstat:
external/bsd/iscsi/dist/src/initiator/iscsi-initiator.c | 18 +++++++++++++++-
1 files changed, 16 insertions(+), 2 deletions(-)
diffs (28 lines):
diff -r 09d1fa646510 -r 70c8e49671b7 external/bsd/iscsi/dist/src/initiator/iscsi-initiator.c
--- a/external/bsd/iscsi/dist/src/initiator/iscsi-initiator.c Tue Feb 22 13:04:22 2011 +0000
+++ b/external/bsd/iscsi/dist/src/initiator/iscsi-initiator.c Tue Feb 22 13:04:31 2011 +0000
@@ -701,8 +701,22 @@
}
/* stuff size into st.st_size */
- (void) read_capacity(u, 0, &lbac, &blocksize);
- sti.st.st_size = ((uint64_t)lbac + 1) * blocksize;
+ {
+ int retry = 5;
+ while (retry > 0) {
+ if (read_capacity(u, 0, &lbac, &blocksize) == 0)
+ break;
+ retry--;
+ iscsi_warn(__FILE__, __LINE__,
+ "read_capacity failed - retrying %d\n", retry);
+ sleep(1);
+ }
+ if (retry == 0) {
+ iscsi_err(__FILE__, __LINE__, "read_capacity failed - giving up\n");
+ break;
+ }
+ }
+ sti.st.st_size = (off_t)(((uint64_t)lbac + 1) * blocksize);
sti.target = u;
tv.v[tv.c].host = strdup(tinfo.name);
Home |
Main Index |
Thread Index |
Old Index