[PATCH] udf: propagate error from udf_fiiter_add_entry

From: Tristan Madani

Date: Sat Apr 18 2026 - 09:11:53 EST


From: Tristan Madani <tristan@xxxxxxxxxxxxxxxxxxx>

udf_fiiter_add_entry() triggers a WARN when it encounters an error
condition but does not propagate the error to callers. This can be
triggered by a corrupted filesystem image.

Replace the WARN with proper error propagation to allow callers to
handle the failure gracefully.

Reported-by: syzbot+969e250fc7983fc7417c@xxxxxxxxxxxxxxxxxxxxxxxxx
Cc: stable@xxxxxxxxxxxxxxx
Signed-off-by: Tristan Madani <tristan@xxxxxxxxxxxxxxxxxxx>
---
fs/udf/namei.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/fs/udf/namei.c b/fs/udf/namei.c
index 9a3b7cef36064..2249b79c0e0b2 100644
--- a/fs/udf/namei.c
+++ b/fs/udf/namei.c
@@ -207,14 +207,9 @@ static int udf_expand_dir_adinicb(struct inode *inode, udf_pblk_t *block)
udf_fiiter_write_fi(&iter, impuse);
}
brelse(dbh);
- /*
- * We don't expect the iteration to fail as the directory has been
- * already verified to be correct
- */
- WARN_ON_ONCE(ret);
udf_fiiter_release(&iter);

- return 0;
+ return ret;
}

static int udf_fiiter_add_entry(struct inode *dir, struct dentry *dentry,
--
2.47.3