summaryrefslogtreecommitdiff
path: root/util/nvmutil
diff options
context:
space:
mode:
Diffstat (limited to 'util/nvmutil')
-rw-r--r--util/nvmutil/nvmutil.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c
index 4cc35505..fe8364f7 100644
--- a/util/nvmutil/nvmutil.c
+++ b/util/nvmutil/nvmutil.c
@@ -2086,19 +2086,6 @@ real_pread_pwrite:
loop_eagain, loop_eintr);
do {
- if (off != verified)
- goto err_prw;
-
- if (rw_type == IO_PREAD)
- r = read(fd, mem, nrw);
- else if (rw_type == IO_PWRITE)
- r = write(fd, mem, nrw);
-
- if (rw_over_nrw(r, nrw) == -1) {
- errno = EIO;
- break;
- }
-
/*
* Verify again before I/O
* (even with OFF_ERR)
@@ -2119,6 +2106,19 @@ real_pread_pwrite:
verified = lseek_loop(fd, (off_t)0, SEEK_CUR,
loop_eagain, loop_eintr);
+ if (off != verified)
+ goto err_prw;
+
+ if (rw_type == IO_PREAD)
+ r = read(fd, mem, nrw);
+ else if (rw_type == IO_PWRITE)
+ r = write(fd, mem, nrw);
+
+ if (rw_over_nrw(r, nrw) == -1) {
+ errno = EIO;
+ break;
+ }
+
} while (r == -1 &&
(errno == try_err(loop_eintr, EINTR)
|| errno == try_err(loop_eagain, EAGAIN)));