changeset 842:b0852eac72a9

objstore: use the passed in objver's size when reading pages The objver's size is always up to date - even mid-transaction. Therefore, we can use it to determine whether or not page fills should do I/O or get zero filled. This fixes the issue where directories wouldn't be readable until after a cow since the first version's page was zero filled instead of read from disk. Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
author Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
date Thu, 15 Dec 2022 23:22:15 -0500
parents c8ed13a24e47
children 5427f4e9dcb6
files src/objstore/cache.c
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/objstore/cache.c	Thu Dec 15 22:43:13 2022 -0500
+++ b/src/objstore/cache.c	Thu Dec 15 23:22:15 2022 -0500
@@ -174,7 +174,7 @@
 
 		int ret;
 
-		if (pgno < (p2roundup(ver->txn.min_size, PAGE_SIZE) / PAGE_SIZE)) {
+		if (pgno < (p2roundup(ver->attrs.size, PAGE_SIZE) / PAGE_SIZE)) {
 			/* existed before */
 			ret = ver->obj->ops->read_page(ver, page->ptr, pgno);
 			if (ret) {