mirror of
https://github.com/versity/scoutfs.git
synced 2026-08-15 11:46:35 +00:00
Fix ring block replay
The ring block replay walk messed up the blkno it read from and its exit condition. It needed to test for having just replayed the tail before moving on. Signed-off-by: Zach Brown <zab@versity.com>
This commit is contained in:
+6
-3
@@ -227,7 +227,7 @@ int scoutfs_ring_read(struct super_block *sb)
|
||||
tail = le64_to_cpu(super->ring_tail_index);
|
||||
seq = le64_to_cpu(super->ring_head_seq);
|
||||
|
||||
do {
|
||||
for(;;) {
|
||||
blkno = le64_to_cpu(super->ring_blkno) + index;
|
||||
|
||||
if (index <= tail)
|
||||
@@ -236,7 +236,7 @@ int scoutfs_ring_read(struct super_block *sb)
|
||||
nr = le64_to_cpu(super->ring_blocks) - index;
|
||||
nr = min_t(int, nr, NR_BLOCKS);
|
||||
|
||||
ret = scoutfs_bio_read(sb, pages, index, nr);
|
||||
ret = scoutfs_bio_read(sb, pages, blkno, nr);
|
||||
if (ret)
|
||||
goto out;
|
||||
|
||||
@@ -249,10 +249,13 @@ int scoutfs_ring_read(struct super_block *sb)
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (index == tail)
|
||||
break;
|
||||
|
||||
index += nr;
|
||||
if (index == le64_to_cpu(super->ring_blocks))
|
||||
index = 0;
|
||||
} while (index != tail);
|
||||
}
|
||||
|
||||
out:
|
||||
for (i = 0; i < NR_PAGES && pages && pages[i]; i++)
|
||||
|
||||
Reference in New Issue
Block a user