public inbox for linux-fsdevel@vger.kernel.org
 help / color / mirror / Atom feed
From: Luis Henriques <luis@igalia.com>
To: Miklos Szeredi <miklos@szeredi.hu>,
	Joanne Koong <joannelkoong@gmail.com>
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	Luis Henriques <luis@igalia.com>
Subject: [PATCH] fuse: remove WARN_ON_ONCE() from fuse_iomap_writeback_{range,submit}()
Date: Tue,  2 Sep 2025 16:22:34 +0100	[thread overview]
Message-ID: <20250902152234.35173-1-luis@igalia.com> (raw)

The usage of WARN_ON_ONCE doesn't seem to be necessary in these functions.
All fuse_iomap_writeback_submit() call sites already ensure that wpc->wb_ctx
contains a valid fuse_fill_wb_data.

Function fuse_iomap_writeback_range() also seems to always be called with a
valid value.  But even if this wasn't the case, there would be a crash
before this WARN_ON_ONCE() because ->wpa is being accessed before it.

Signed-off-by: Luis Henriques <luis@igalia.com>
---
As I'm saying above, I _think_ there's no need for these WARN_ON_ONCE().
However, if I'm wrong and they are required, I believe there's a need for
a different patch (I can send one) to actually prevent a kernel crash.

 fs/fuse/file.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/fs/fuse/file.c b/fs/fuse/file.c
index 5525a4520b0f..fac52f9fb333 100644
--- a/fs/fuse/file.c
+++ b/fs/fuse/file.c
@@ -2142,8 +2142,6 @@ static ssize_t fuse_iomap_writeback_range(struct iomap_writepage_ctx *wpc,
 	struct fuse_conn *fc = get_fuse_conn(inode);
 	loff_t offset = offset_in_folio(folio, pos);
 
-	WARN_ON_ONCE(!data);
-
 	if (!data->ff) {
 		data->ff = fuse_write_file_get(fi);
 		if (!data->ff)
@@ -2182,8 +2180,6 @@ static int fuse_iomap_writeback_submit(struct iomap_writepage_ctx *wpc,
 {
 	struct fuse_fill_wb_data *data = wpc->wb_ctx;
 
-	WARN_ON_ONCE(!data);
-
 	if (data->wpa) {
 		WARN_ON(!data->wpa->ia.ap.num_folios);
 		fuse_writepages_send(wpc->inode, data);

             reply	other threads:[~2025-09-02 15:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-02 15:22 Luis Henriques [this message]
2025-09-02 17:35 ` [PATCH] fuse: remove WARN_ON_ONCE() from fuse_iomap_writeback_{range,submit}() Joanne Koong
2025-09-02 18:07   ` Luis Henriques
2025-09-02 18:31     ` Joanne Koong
2025-09-02 20:13       ` Luis Henriques

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=20250902152234.35173-1-luis@igalia.com \
    --to=luis@igalia.com \
    --cc=joannelkoong@gmail.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    /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