All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Robertson <dan@dlrobertson.com>
To: linux-bcachefs@vger.kernel.org
Cc: Dan Robertson <dan@dlrobertson.com>,
	Kent Overstreet <kent.overstreet@gmail.com>
Subject: [PATCH 1/1] generic/103: increase reserved bytes for bcachefs
Date: Thu, 24 Jun 2021 22:11:18 -0400	[thread overview]
Message-ID: <20210625021118.28813-2-dan@dlrobertson.com> (raw)
In-Reply-To: <20210625021118.28813-1-dan@dlrobertson.com>

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.

Signed-off-by: Dan Robertson <dan@dlrobertson.com>
---
 tests/generic/103 | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/tests/generic/103 b/tests/generic/103
index b22b0159..610f31f6 100755
--- a/tests/generic/103
+++ b/tests/generic/103
@@ -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
 }
 

  reply	other threads:[~2021-06-25  2:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-25  2:11 [PATCH 0/1] generic/103: increase reserved bytes for bcachefs Dan Robertson
2021-06-25  2:11 ` Dan Robertson [this message]
2021-06-25  3:05   ` [PATCH 1/1] " Kent Overstreet

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210625021118.28813-2-dan@dlrobertson.com \
    --to=dan@dlrobertson.com \
    --cc=kent.overstreet@gmail.com \
    --cc=linux-bcachefs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.