From: Dan Carpenter <dan.carpenter@linaro.org>
To: Filipe Manana <fdmanana@suse.com>
Cc: Chris Mason <clm@fb.com>, Josef Bacik <josef@toxicpanda.com>,
David Sterba <dsterba@suse.com>, Boris Burkov <boris@bur.io>,
Qu Wenruo <wqu@suse.com>,
linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org,
kernel-janitors@vger.kernel.org
Subject: [PATCH next] btrfs: fix error code in add_delayed_ref_head()
Date: Thu, 31 Oct 2024 10:23:33 +0300 [thread overview]
Message-ID: <8a26ccf8-707e-4004-8077-0d8b56501d83@stanley.mountain> (raw)
xa_err errors are equivalent to "error_code * 4 + 2". We want to return
error pointers here so we can't just cast them back and forth. Use
xa_err() to do the conversion.
Fixes: 6d50990e6be2 ("btrfs: track delayed ref heads in an xarray")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
fs/btrfs/delayed-ref.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/btrfs/delayed-ref.c b/fs/btrfs/delayed-ref.c
index 1f97e1e5c66c..012fce255866 100644
--- a/fs/btrfs/delayed-ref.c
+++ b/fs/btrfs/delayed-ref.c
@@ -848,7 +848,7 @@ add_delayed_ref_head(struct btrfs_trans_handle *trans,
if (xa_is_err(existing)) {
/* Memory was preallocated by the caller. */
ASSERT(xa_err(existing) != -ENOMEM);
- return ERR_CAST(existing);
+ return ERR_PTR(xa_err(existing));
} else if (WARN_ON(existing)) {
/*
* Shouldn't happen we just did a lookup before under
--
2.45.2
next reply other threads:[~2024-10-31 7:23 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-31 7:23 Dan Carpenter [this message]
2024-10-31 11:59 ` Filipe Manana
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=8a26ccf8-707e-4004-8077-0d8b56501d83@stanley.mountain \
--to=dan.carpenter@linaro.org \
--cc=boris@bur.io \
--cc=clm@fb.com \
--cc=dsterba@suse.com \
--cc=fdmanana@suse.com \
--cc=josef@toxicpanda.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-btrfs@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=wqu@suse.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®