summaryrefslogtreecommitdiff
path: root/util/nvmutil/nvmutil.c
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2026-03-12 16:16:09 +0000
committerLeah Rowe <leah@libreboot.org>2026-03-12 16:16:09 +0000
commit9656e78c3ad8bf18cbaea56c57aef7ac969de174 (patch)
treef3fbcf41474f009b4bf13cbc0f6701a8fcb11a69 /util/nvmutil/nvmutil.c
parent571c47486613f43abe9221bbfb86dcab9d2663ca (diff)
TODO
Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'util/nvmutil/nvmutil.c')
-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;
}