Corretly wait on submitted segment reads

The segment waiting loop was rewritten to use n to
iterate up to i, but the body of the loop still had i.  Take that as a
signal to Always Iterate With 'i' and store the last i and then
iterate towards it with i again.

Signed-off-by: Zach Brown <zab@versity.com>
This commit is contained in:
Zach Brown
2017-04-18 13:42:30 -07:00
parent d1f36e2165
commit 21d313e0f6
+3 -1
View File
@@ -295,6 +295,7 @@ int scoutfs_manifest_read_items(struct super_block *sb, struct kvec *key)
int err;
int nr_refs;
int cmp;
int last;
int i;
int n;
@@ -314,9 +315,10 @@ int scoutfs_manifest_read_items(struct super_block *sb, struct kvec *key)
refs[i].seg = seg;
}
last = i;
/* wait for submitted segments and search if we haven't seen failure */
for (n = 0; n < i; n++) {
for (i = 0; i < last; i++) {
seg = refs[i].seg;
err = scoutfs_seg_wait(sb, seg);