From: Sascha Hauer <s.hauer@pengutronix.de>
To: BAREBOX <barebox@lists.infradead.org>
Subject: [PATCH 07/13] fs: fat: fix building without CONFIG_FS_FAT_LFN
Date: Wed, 18 Nov 2026 15:51:57 +0100 [thread overview]
Message-ID: <20261118-fs-conformance-fixes-v1-7-59b59ec15d47@pengutronix.de> (raw)
In-Reply-To: <20261118-fs-conformance-fixes-v1-0-59b59ec15d47@pengutronix.de>
FILINFO only has the lfname and lfsize fields with long file name
support, so the FAT fuzz test, which sets them depending on
IS_ENABLED(CONFIG_FS_FAT_LFN), breaks building FAT without it:
fs/fat/fat.c: error: 'FILINFO' has no member named 'lfname'
Use #ifdef like the rest of the driver does.
Fixes: f585092b1737 ("fs: fat: add fuzz test for FAT filesystem")
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
fs/fat/fat.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/fs/fat/fat.c b/fs/fat/fat.c
index 1c5aa257b4..f413c1cd8f 100644
--- a/fs/fat/fat.c
+++ b/fs/fat/fat.c
@@ -454,7 +454,9 @@ static int fuzz_fat(struct block_device *ramdisk)
BYTE buf[512];
UINT br;
int ret, i;
+#ifdef CONFIG_FS_FAT_LFN
char lfname[256];
+#endif
priv.cdev = &ramdisk->cdev;
fat.userdata = &priv;
@@ -475,10 +477,11 @@ static int fuzz_fat(struct block_device *ramdisk)
for (i = 0; i < 64; i++) {
memset(&finfo, 0, sizeof(finfo));
- if (IS_ENABLED(CONFIG_FS_FAT_LFN)) {
- finfo.lfname = lfname;
- finfo.lfsize = sizeof(lfname);
- }
+#ifdef CONFIG_FS_FAT_LFN
+ /* FILINFO only has the fields for long names with LFN */
+ finfo.lfname = lfname;
+ finfo.lfsize = sizeof(lfname);
+#endif
ret = f_readdir(&dir, &finfo);
if (ret || finfo.fname[0] == '\0')
--
2.47.3
next prev parent reply other threads:[~2026-11-18 14:54 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-18 14:51 [PATCH 00/13] fs: fixes found by file system conformance tests Sascha Hauer
2026-11-18 14:51 ` [PATCH 01/13] fs: ramfs: zero the rest of a chunk when truncating Sascha Hauer
2026-11-18 14:51 ` [PATCH 02/13] fs: fat: zero-fill files grown by truncate Sascha Hauer
2026-11-18 14:51 ` [PATCH 03/13] fs: keep the file size when O_TRUNC fails Sascha Hauer
2026-11-18 14:51 ` [PATCH 04/13] fs: legacy: return -EPERM when a driver can't create symlinks Sascha Hauer
2026-11-18 14:51 ` [PATCH 05/13] fs: uimagefs: allow opening a file more than once Sascha Hauer
2026-11-18 14:51 ` [PATCH 06/13] fs: nfs: drop the write and truncate stubs Sascha Hauer
2026-11-18 14:51 ` Sascha Hauer [this message]
2026-11-18 14:51 ` [PATCH 08/13] fs: bpkfs: skip the data of ignored duplicates Sascha Hauer
2026-11-18 14:51 ` [PATCH 09/13] fs: bpkfs: allow opening a file more than once Sascha Hauer
2026-11-18 14:52 ` [PATCH 10/13] fs: bpkfs: make room for the NUL after the checksum string Sascha Hauer
2026-11-18 14:52 ` [PATCH 11/13] fs: pstore: read from the file position Sascha Hauer
2026-11-18 14:52 ` [PATCH 12/13] fs: pstore: don't free the records when unmounting Sascha Hauer
2026-11-18 14:52 ` [PATCH 13/13] fs: efivarfs: zero-fill variables grown by truncate Sascha Hauer
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=20261118-fs-conformance-fixes-v1-7-59b59ec15d47@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=barebox@lists.infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox