From bf7b3ac5064c32febe63af6a6be678fa67a4d879 Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Fri, 16 Jun 2017 23:22:28 -0700 Subject: [PATCH] scoutfs: fix ring first_seq calculation As we write ring blocks we need to update the first_seq to point at the first live block in the ring. The existing calculation gets it wrong and stores the seq of the first block that we wrote in this commit, not the first ring block that is still live and would need to be read. Fix the calculation to so that we set first_seq to the first live block in the ring. This fixes the bug where a mount can spin printing the super it's using. This is the server trying to constantly startup as each server start fails as it can't read the ring. Signed-off-by: Zach Brown --- kmod/src/ring.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kmod/src/ring.c b/kmod/src/ring.c index 47a21bc9..657bfe82 100644 --- a/kmod/src/ring.c +++ b/kmod/src/ring.c @@ -731,7 +731,7 @@ int scoutfs_ring_submit_write(struct super_block *sb, nr = last + le64_to_cpu(rdesc->total_blocks) - first; rdesc->first_block = cpu_to_le64(first); - rdesc->first_seq = cpu_to_le64(ring->first_dirty_seq); + rdesc->first_seq = cpu_to_le64(ring->first_dirty_seq + nr_blocks - nr); rdesc->nr_blocks = cpu_to_le64(nr); /* the contig dirty blocks in pages might wrap around ring */