Hi Heinrich,
On 2026-05-18T05:57:19, Heinrich Schuchardt
<[email protected]> wrote:
> fs: ext4: don't read time fields in XPL
>
> The ext4 readdir implementation populates dent time fields in XML
> builds though that information is never used.
>
> Guard the three rtc_to_tm() calls with !IS_ENABLED(CONFIG_XPL_BUILD),
> consistent with the FAT driver.
>
> Signed-off-by: Heinrich Schuchardt <[email protected]>
>
> fs/ext4/ext4fs.c | 8 +++++---
> 1 file changed, 5 insertions(+), 3 deletions(-)
> diff --git a/fs/ext4/ext4fs.c b/fs/ext4/ext4fs.c
> @@ -319,9 +319,11 @@ int ext4fs_readdir(struct fs_dir_stream *fs_dirs, struct
> fs_dirent **dentp)
> - rtc_to_tm(fdiro.inode.atime, &dent->access_time);
> - rtc_to_tm(fdiro.inode.ctime, &dent->create_time);
> - rtc_to_tm(fdiro.inode.mtime, &dent->change_time);
> + if (!IS_ENABLED(CONFIG_XPL_BUILD)) {
> + rtc_to_tm(le32_to_cpu(fdiro.inode.atime), &dent->access_time);
> + rtc_to_tm(le32_to_cpu(fdiro.inode.ctime), &dent->create_time);
> + rtc_to_tm(le32_to_cpu(fdiro.inode.mtime), &dent->change_time);
> + }
The le32_to_cpu() addition is a separate fix from the XPL guard,
right? Please mention the endianness fix in the commit message, or
better, split it into its own patch that can be backported
independently.
BTW dent->size on the next line has the same problem, doesn't it?
> fs: ext4: don't read time fields in XPL
>
> The ext4 readdir implementation populates dent time fields in XML
> builds though that information is never used.
Typo: XML should be xPL
Regards,
Simon