Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #247811

Re: file born 30 seconds after its creation on ext4 - bug?

From David Wright <deblis@lionunicorn.co.uk>
Newsgroups linux.debian.user
Subject Re: file born 30 seconds after its creation on ext4 - bug?
Date 2022-05-02 17:10 +0200
Message-ID <EiFQt-cIDO-1@gated-at.bofh.it> (permalink)
References <EhUyd-cdxO-5@gated-at.bofh.it> <EhVaV-ce0V-3@gated-at.bofh.it> <Eirkt-cyHx-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Mon 02 May 2022 at 01:30:08 (+0200), Vincent Lefevre wrote:
> On 2022-04-30 15:19:21 +0200, Thomas Schmitt wrote:
> > An explanation of the observed problem would need:
> > - a mechanism which delayed the content production of the inode while it
> >   was already in use for open and write,
> > - or a mechanism which caused ext4 to hide the inode to other processes
> >   and to write a wrong birth timestamp,
> > - or a mechanism which deleted the file shortly after it was created and
> >   re-created it 30 seconds later with its full expected content,
> > - or something of which i cannot think yet.
> > 
> > (The birth timestamp happens to match roughly the time when the file finally
> > became visible to other processes. It matches the modification time of the
> > finally visible file.)
> 
> I'm wondering whether the data are transferred from the VFS to ext4
> necessarily within the same openat system call or could just be kept
> in the VFS as long as they are not needed elsewhere, i.e. the VFS
> behaving like a cache. In the latter case, since the VFS doesn't
> have a notion of birth timestamp (from the code I've read), a bug
> in the VFS code could explain the behavior I had observed. This is
> the only explanation I could have.

I'm not very familiar with files' birth as it's a relatively new
addition to filesystems, particularly how to display it even when
present. So I looked it up, and the ext4 wiki says it's the time
at which the inode is created. I also read in ext4 wikipedia:

  Multiblock allocator

    When ext3 appends to a file, it calls the block allocator, once
    for each block. Consequently, if there are multiple concurrent
    writers, files can easily become fragmented on disk. However, ext4
    uses delayed allocation, which allows it to buffer data and
    allocate groups of blocks. Consequently, the multiblock allocator
    can make better choices about allocating files contiguously on
    disk. The multiblock allocator can also be used when files are
    opened in O_DIRECT mode. This feature does not affect the disk
    format.

So I wondered whether a delayed birth time could be caused by the
filesystem waiting a while before it actually starts creating any
allocation for the file on the disk. Having amassed some data,
depending on its size, it decides where it's going to write it,
ie which block group. Only then does it create the file's inode,
so that it can keep file contents and inode close together.

Cheers,
David.

Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

file born 30 seconds after its creation on ext4 - bug? Vincent Lefevre <vincent@vinc17.net> - 2022-04-26 15:50 +0200
  Re: file born 30 seconds after its creation on ext4 - bug? "Thomas Schmitt" <scdbackup@gmx.net> - 2022-04-26 19:10 +0200
    Re: file born 30 seconds after its creation on ext4 - bug? Vincent Lefevre <vincent@vinc17.net> - 2022-04-27 04:40 +0200
      Re: file born 30 seconds after its creation on ext4 - bug? "Thomas Schmitt" <scdbackup@gmx.net> - 2022-04-27 09:10 +0200
        Re: file born 30 seconds after its creation on ext4 - bug? Vincent Lefevre <vincent@vinc17.net> - 2022-04-27 10:30 +0200
          Re: file born 30 seconds after its creation on ext4 - bug? "Thomas Schmitt" <scdbackup@gmx.net> - 2022-04-27 11:40 +0200
            Re: file born 30 seconds after its creation on ext4 - bug? Vincent Lefevre <vincent@vinc17.net> - 2022-04-27 15:20 +0200
              Re: file born 30 seconds after its creation on ext4 - bug? Greg Wooledge <greg@wooledge.org> - 2022-04-27 15:30 +0200
                Re: file born 30 seconds after its creation on ext4 - bug? Vincent Lefevre <vincent@vinc17.net> - 2022-04-27 16:10 +0200
                Re: file born 30 seconds after its creation on ext4 - bug? Stefan Monnier <monnier@iro.umontreal.ca> - 2022-04-28 04:50 +0200
                Re: file born 30 seconds after its creation on ext4 - bug? Greg Wooledge <greg@wooledge.org> - 2022-04-28 05:10 +0200
                Re: file born 30 seconds after its creation on ext4 - bug? duh <fill_in_the_blanks@email.com> - 2022-04-29 16:20 +0200
                Re: file born 30 seconds after its creation on ext4 - bug? Marc Auslander <marcausl@gmail.com> - 2022-04-29 20:10 +0200
                Re: file born 30 seconds after its creation on ext4 - bug? "sp007@caiway.net" <sp007@caiway.net> - 2022-04-29 22:10 +0200
                Re: file born 30 seconds after its creation on ext4 - bug? <tomas@tuxteam.de> - 2022-04-30 07:40 +0200
                Re: file born 30 seconds after its creation on ext4 - bug? "Thomas Schmitt" <scdbackup@gmx.net> - 2022-04-30 10:40 +0200
                Re: file born 30 seconds after its creation on ext4 - bug? <tomas@tuxteam.de> - 2022-04-30 14:10 +0200
                Re: file born 30 seconds after its creation on ext4 - bug? Vincent Lefevre <vincent@vinc17.net> - 2022-05-02 01:20 +0200
                Re: file born 30 seconds after its creation on ext4 - bug? <tomas@tuxteam.de> - 2022-05-02 07:30 +0200
                Re: file born 30 seconds after its creation on ext4 - bug? Curt <curty@free.fr> - 2022-04-30 14:40 +0200
                Re: file born 30 seconds after its creation on ext4 - bug? <tomas@tuxteam.de> - 2022-04-30 15:10 +0200
                Re: file born 30 seconds after its creation on ext4 - bug? "Thomas Schmitt" <scdbackup@gmx.net> - 2022-04-30 15:20 +0200
                Re: file born 30 seconds after its creation on ext4 - bug? Vincent Lefevre <vincent@vinc17.net> - 2022-05-02 01:40 +0200
                Re: file born 30 seconds after its creation on ext4 - bug? Greg Wooledge <greg@wooledge.org> - 2022-05-02 01:40 +0200
                Re: file born 30 seconds after its creation on ext4 - bug? David Wright <deblis@lionunicorn.co.uk> - 2022-05-02 17:10 +0200
                Re: file born 30 seconds after its creation on ext4 - bug? <tomas@tuxteam.de> - 2022-05-02 18:20 +0200
                Re: file born 30 seconds after its creation on ext4 - bug? Vincent Lefevre <vincent@vinc17.net> - 2022-04-28 10:40 +0200
            Re: file born 30 seconds after its creation on ext4 - bug? Vincent Lefevre <vincent@vinc17.net> - 2022-04-28 11:40 +0200
  Re: file born 30 seconds after its creation on ext4 - bug? Nicholas Geovanis <nickgeovanis@gmail.com> - 2022-04-26 19:40 +0200
    Re: file born 30 seconds after its creation on ext4 - bug? Nicholas Geovanis <nickgeovanis@gmail.com> - 2022-04-26 19:50 +0200
      Re: file born 30 seconds after its creation on ext4 - bug? Vincent Lefevre <vincent@vinc17.net> - 2022-04-27 04:50 +0200
  Re: file born 30 seconds after its creation on ext4 - bug? Stefan Monnier <monnier@iro.umontreal.ca> - 2022-04-26 20:20 +0200
    Re: file born 30 seconds after its creation on ext4 - bug? Vincent Lefevre <vincent@vinc17.net> - 2022-04-27 05:10 +0200
  Re: file born 30 seconds after its creation on ext4 - bug? "Thomas Schmitt" <scdbackup@gmx.net> - 2022-04-28 11:30 +0200
    Re: file born 30 seconds after its creation on ext4 - bug? Vincent Lefevre <vincent@vinc17.net> - 2022-04-28 12:20 +0200

csiph-web