Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

David Laight and committed by
Theodore Ts'o
6ea3b34d 52b4fea1

+3 -3
+3 -3
fs/ext4/namei.c
··· 647 647 /* Directory is not encrypted */ 648 648 (void) ext4fs_dirhash(dir, de->name, 649 649 de->name_len, &h); 650 - printk("%*.s:(U)%x.%u ", len, 650 + printk("%.*s:(U)%x.%u ", len, 651 651 name, h.hash, 652 652 (unsigned) ((char *) de 653 653 - base)); ··· 683 683 (void) ext4fs_dirhash(dir, 684 684 de->name, 685 685 de->name_len, &h); 686 - printk("%*.s:(E)%x.%u ", len, name, 686 + printk("%.*s:(E)%x.%u ", len, name, 687 687 h.hash, (unsigned) ((char *) de 688 688 - base)); 689 689 fscrypt_fname_free_buffer( ··· 694 694 char *name = de->name; 695 695 (void) ext4fs_dirhash(dir, de->name, 696 696 de->name_len, &h); 697 - printk("%*.s:%x.%u ", len, name, h.hash, 697 + printk("%.*s:%x.%u ", len, name, h.hash, 698 698 (unsigned) ((char *) de - base)); 699 699 #endif 700 700 }