Skip to contentSkip to conversation

generic/103: increase reserved bytes for bcachefs

PATCH In review Dan Robertson 2 participants 3 messages Jun 25, 2021

lore
Share & tools
lore
#0 lore raw

cover generic/103: increase reserved bytes for bcachefs

After some testing it seems that generic/103 fails intermittently due to a split leaf that can be hit in fallocate. Since the bcachefs node sizes are larger on bcachefs than some other filesystems the reserved size needs to be bumped up a bit when FSTYP is bcachefs.

On a system that generic/103 failed semi-regularly on, I can now it in a loop without hitting a failure.

Dan Robertson (1):
generic/103: increase reserved bytes for bcachefs

 tests/generic/103 | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
#1 lore raw

PATCH 1/1 generic/103: increase reserved bytes for bcachefs

The bcachefs btree nodes are quite large. If we only reserve 512 bytes we hit an intermittent failure where the fallocate that is intented to fill the available space triggers a btree node split and the exente update is interrupted. The retry of the extent update will fail because the new amount of available space is less than that of the request.

---
 tests/generic/103 | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
tests/generic/103 +9 -1
index b22b0159..610f31f6 100755
@@ -43,7 +43,15 @@ _consume_freesp()
 
 	# consume nearly all available space (leave ~512kB)
 	avail=`_get_available_space $SCRATCH_MNT`
-	filesizekb=$((avail / 1024 - 512))
+	if [ $FSTYP = "bcachefs" ]; then
+		# The bcachefs btree nodes are quite large. If the fallocate
+		# triggers a split leaf of a btree node, we'll need more
+		# than 512 kept in reserve.
+		reserve=1024
+	else
+		reserve=512
+	fi
+	filesizekb=$((avail / 1024 - reserve))
 	$XFS_IO_PROG -fc "falloc 0 ${filesizekb}k" $file
 }
 
#2 lore raw
Quoted 7 lines · Dan Robertson

The bcachefs btree nodes are quite large. If we only reserve 512 bytes we hit an intermittent failure where the fallocate that is intented to fill the available space triggers a btree node split and the exente update is interrupted. The retry of the extent update will fail because the new amount of available space is less than that of the request.

Thanks, merged