RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1806567 - [RFE] stat should also report crtime where possible (ext4)
Summary: [RFE] stat should also report crtime where possible (ext4)
Keywords:
Status: CLOSED DUPLICATE of bug 1760300
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: coreutils
Version: 8.2
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: 8.0
Assignee: Kamil Dudka
QA Contact: Radka Brychtova
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-02-24 14:36 UTC by Ondrej
Modified: 2020-03-06 11:50 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-03-06 11:50:18 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Ondrej 2020-02-24 14:36:45 UTC
Description of problem:

Stat does not report file create time: 

[root@skynet19 mnt]# stat test.txt 
  File: test.txt
  Size: 0         	Blocks: 0          IO Block: 4096   regular empty file
Device: fd06h/64774d	Inode: 12          Links: 1
Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
Context: unconfined_u:object_r:unlabeled_t:s0
Access: 2020-02-24 09:23:45.470068100 -0500
Modify: 2020-02-24 09:23:45.470068100 -0500
Change: 2020-02-24 09:23:45.470068100 -0500
 Birth: -

But certain filesystems (ext4) do record crtime, so it could be nice if 'stat' could print that timestamp, where possible

Version-Release number of selected component (if applicable):
coreutils-8.30-6.el8.x86_64

How reproducible:
always

Comment 1 Kamil Dudka 2020-02-28 13:52:01 UTC
Could you please try coreutils-8.31-6.1.el8 from the following COMPLETELY UNSUPPORTED copr and check whether it solves the problem for you?

    https://copr.fedorainfracloud.org/coprs/kdudka/coreutils-statx/

Comment 2 Ondrej 2020-02-28 15:46:30 UTC
I can confirm that it works nicely. Good stuff!
2 questions:
- I noticed it works not only on ext4, but also on xfs (which to my knowledge has no support of crtime). How is that possible?
- is there any chance this useful feature will find it's way into the official RH repo?
Thanks,

Comment 3 Kamil Dudka 2020-02-28 16:39:19 UTC
(In reply to Ondrej from comment #2)
> I can confirm that it works nicely. Good stuff!

Thanks for confirmation!

> 2 questions:
> - I noticed it works not only on ext4, but also on xfs (which to my
> knowledge has no support of crtime). How is that possible?

coreutils gets the information from the statx() syscall but I know nothing about the actual implementation of the syscall in Linux kernel.

> - is there any chance this useful feature will find it's way into the
> official RH repo?

Unfortunately, it had to be temporarily reverted even in Fedora because it did not work well on el7-hosted virtual machines due to bugs in kernel/seccomp.  See bug #1760300 for details.

Comment 4 Kamil Dudka 2020-03-06 11:50:18 UTC
Let's close this as a duplicate of bug #1760300 because the proposed patch will fix this as well.

*** This bug has been marked as a duplicate of bug 1760300 ***


Note You need to log in before you can comment on or make changes to this bug.