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
index 3c79a889bc2..abf4a9835bc 100644
--- 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)
                dent->type = FILETYPE_UNKNOWN;
        }
 
-       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);
+       }
 
        dirs->fpos += le16_to_cpu(dirent.direntlen);
        dent->size = fdiro.inode.size;
-- 
2.53.0


Reply via email to