summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
Diffstat (limited to 'util')
-rw-r--r--util/nvmutil/nvmutil.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c
index c838b2e5..e8c6ae2e 100644
--- a/util/nvmutil/nvmutil.c
+++ b/util/nvmutil/nvmutil.c
@@ -1479,6 +1479,17 @@ read_again:
*/
if ((size_t)rv > (len - rc) /* Prevent overflow */
|| rv == 0) { /* Prevent infinite 0-byte loop */
+ /*
+ * TODO: handle rv == 0 this way:
+ * re-try a finite number of times,
+ * based on a counter, that resets
+ * on a non-zero read but then returns
+ * like below if the counter reaches
+ * the limit. This will retain the
+ * current safety, while increasing
+ * robustness e.g. on unreliable NFS
+ * shares or really slow media.
+ */
errno = EIO;
return -1;
}