diff options
| author | David Laight <david.laight.linux@gmail.com> | 2026-03-26 23:18:04 +0300 |
|---|---|---|
| committer | Theodore Ts'o <tytso@mit.edu> | 2026-04-10 04:54:33 +0300 |
| commit | 6ea3b34d8625ef5544d1c619bd67e2c6080ea4c2 (patch) | |
| tree | a7dad2665e62060c4756b7bd8069131d15622e85 | |
| parent | 52b4fea162dd384792d0dec7f817e4ba5d8d4c9b (diff) | |
| download | linux-6ea3b34d8625ef5544d1c619bd67e2c6080ea4c2.tar.xz | |
ext4: fix diagnostic printf formats
The formats for non-terminated names should be "%.*s" not "%*.s".
The kernel currently treats "%*.s" as equivalent to "%*s" whereas
userspace requires it be equivalent to "%*.0s".
Neither is correct here.
Signed-off-by: David Laight <david.laight.linux@gmail.com>
Link: https://patch.msgid.link/20260326201804.3881-1-david.laight.linux@gmail.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
| -rw-r--r-- | fs/ext4/namei.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c index 0b8e25198b17..838c01eb46ea 100644 --- a/fs/ext4/namei.c +++ b/fs/ext4/namei.c @@ -647,7 +647,7 @@ static struct stats dx_show_leaf(struct inode *dir, /* Directory is not encrypted */ (void) ext4fs_dirhash(dir, de->name, de->name_len, &h); - printk("%*.s:(U)%x.%u ", len, + printk("%.*s:(U)%x.%u ", len, name, h.hash, (unsigned) ((char *) de - base)); @@ -683,7 +683,7 @@ static struct stats dx_show_leaf(struct inode *dir, (void) ext4fs_dirhash(dir, de->name, de->name_len, &h); - printk("%*.s:(E)%x.%u ", len, name, + printk("%.*s:(E)%x.%u ", len, name, h.hash, (unsigned) ((char *) de - base)); fscrypt_fname_free_buffer( @@ -694,7 +694,7 @@ static struct stats dx_show_leaf(struct inode *dir, char *name = de->name; (void) ext4fs_dirhash(dir, de->name, de->name_len, &h); - printk("%*.s:%x.%u ", len, name, h.hash, + printk("%.*s:%x.%u ", len, name, h.hash, (unsigned) ((char *) de - base)); #endif } |
