From 15e9e00a5aa4f56ca1cff7749c166e072d7cb6ac Mon Sep 17 00:00:00 2001 From: Paulo Alcantara Date: Tue, 14 Apr 2026 11:37:21 -0300 Subject: vfs: get rid of BUG_ON() in d_mark_tmpfile_name() Do proper error handling in d_mark_tmpfile_name() by returning errors rather than using BUG_ON()'s. Adjust caller to check for errors from d_mark_tmpfile_name() as well as clean it up for using return value from scnprintf() in QSTR_LEN() to make it more obvious where the tmpfile name's length is coming from. Link: https://lore.kernel.org/r/CAHk-=wgerpUKCDhdzKH0FEdLyfhj3doc9t+kO9Yb6rSsTp7hdQ@mail.gmail.com Suggested-by: Linus Torvalds Reviewed-by: David Howells Signed-off-by: Paulo Alcantara (Red Hat) Cc: Christian Brauner Cc: Jan Kara CC: linux-fsdevel@vger.kernel.org Cc: linux-cifs@vger.kernel.org Signed-off-by: Steve French --- include/linux/dcache.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/linux') diff --git a/include/linux/dcache.h b/include/linux/dcache.h index f60819dcfebd..c5bd5a74baba 100644 --- a/include/linux/dcache.h +++ b/include/linux/dcache.h @@ -264,7 +264,7 @@ extern void d_invalidate(struct dentry *); extern struct dentry * d_make_root(struct inode *); extern void d_mark_tmpfile(struct file *, struct inode *); -void d_mark_tmpfile_name(struct file *file, const struct qstr *name); +int d_mark_tmpfile_name(struct file *file, const struct qstr *name); extern void d_tmpfile(struct file *, struct inode *); extern struct dentry *d_find_alias(struct inode *); -- cgit v1.2.3