2022-07-22 14:31:51

by Takashi Iwai

[permalink] [raw]
Subject: [PATCH 0/4] exfat: Fixes for ENAMETOOLONG error handling

Hi,

this is a series for fixing the error code of rename syscall as well
as cleanup / suppress the superfluous error messages.

As an LTP test case reported, exfat returns the inconsistent error
code for the case of renaming oversized file names:
https://bugzilla.suse.com/show_bug.cgi?id=1201725
The first patch fixes this inconsistency.

The second patch is just for correcting the definitions as bit flags,
and the remaining two patches are for suppressing the error message
that can be triggered too easily to debug messages.


thanks,

Takashi

===

Takashi Iwai (4):
exfat: Return ENAMETOOLONG consistently for oversized paths
exfat: Define NLS_NAME_* as bit flags explicitly
exfat: Expand exfat_err() and co directly to pr_*() macro
exfat: Downgrade ENAMETOOLONG error message to debug messages

fs/exfat/exfat_fs.h | 21 +++++++++++++--------
fs/exfat/misc.c | 17 -----------------
fs/exfat/namei.c | 2 +-
fs/exfat/nls.c | 2 +-
4 files changed, 15 insertions(+), 27 deletions(-)

--
2.35.3


2022-07-22 14:55:25

by Takashi Iwai

[permalink] [raw]
Subject: [PATCH 4/4] exfat: Downgrade ENAMETOOLONG error message to debug messages

The ENAMETOOLONG error message is printed at each time when user tries
to operate with a too long name, and this can flood the kernel logs
easily, as every user can trigger this. Let's downgrade this error
message level to a debug message for suppressing the superfluous
logs.

BugLink: https://bugzilla.suse.com/show_bug.cgi?id=1201725
Signed-off-by: Takashi Iwai <[email protected]>
---
fs/exfat/nls.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/exfat/nls.c b/fs/exfat/nls.c
index ef115e673406..617aa1272265 100644
--- a/fs/exfat/nls.c
+++ b/fs/exfat/nls.c
@@ -509,7 +509,7 @@ static int exfat_utf8_to_utf16(struct super_block *sb,
}

if (unilen > MAX_NAME_LENGTH) {
- exfat_err(sb, "failed to %s (estr:ENAMETOOLONG) nls len : %d, unilen : %d > %d",
+ exfat_debug(sb, "failed to %s (estr:ENAMETOOLONG) nls len : %d, unilen : %d > %d",
__func__, len, unilen, MAX_NAME_LENGTH);
return -ENAMETOOLONG;
}
--
2.35.3