All of lore.kernel.org
 help / color / mirror / Atom feed
From: Massimiliano Pellizzer <mpellizzer.dev@gmail.com>
To: clm@fb.com, dsterba@suse.com
Cc: linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org,
	Massimiliano Pellizzer <mpellizzer.dev@gmail.com>
Subject: [PATCH] btrfs: remove dead assignment in prepare_one_folio()
Date: Fri, 28 Nov 2025 17:47:55 +0000	[thread overview]
Message-ID: <20251128174804.293605-1-mpellizzer.dev@gmail.com> (raw)

In the error path of prepare_one_folio(), we assign ret = 0
before jumping to the again label to retry the operation.
However, ret is immediately overwritten by
ret = set_folio_extent_mapped(folio).

The zero assignment is never observerd by any code path,
therefore it can be safely removed.

No functional change.

Signed-off-by: Massimiliano Pellizzer <mpellizzer.dev@gmail.com>
---
 fs/btrfs/file.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c
index 7a501e73d880..7d875aa261d1 100644
--- a/fs/btrfs/file.c
+++ b/fs/btrfs/file.c
@@ -877,7 +877,6 @@ static noinline int prepare_one_folio(struct inode *inode, struct folio **folio_
 		/* The folio is already unlocked. */
 		folio_put(folio);
 		if (!nowait && ret == -EAGAIN) {
-			ret = 0;
 			goto again;
 		}
 		return ret;
-- 
2.51.0


             reply	other threads:[~2025-11-28 17:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-28 17:47 Massimiliano Pellizzer [this message]
2025-12-03 21:21 ` [PATCH] btrfs: remove dead assignment in prepare_one_folio() Boris Burkov
2025-12-04 20:51   ` Massimiliano Pellizzer

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=20251128174804.293605-1-mpellizzer.dev@gmail.com \
    --to=mpellizzer.dev@gmail.com \
    --cc=clm@fb.com \
    --cc=dsterba@suse.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-kernel@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.