lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <CADzG2TC8y=sYVYx0rVLAo_o6Mo2tjMOJYAw97ZhKAmNX555a6w@mail.gmail.com>
Date:	Fri, 2 Mar 2012 12:39:57 +0000
From:	Neil Clarkson <neilaclarkson@...il.com>
To:	linux-kernel@...r.kernel.org
Subject: ext4 bug? last write time precedes last mount time on a writable volume!

Isn't the s_wtime field of the ext4 superblock supposed to show the
time, in seconds since the epoch, of the last write? It isn't
happening!

This line suggests the s_wtime is updated on a superblock commit
unless the volume is read only.

static int ext4_commit_super(struct super_block *sb, int sync)'

        /*
         * If the file system is mounted read-only, don't update the
         * superblock write time.  This avoids updating the superblock
         * write time when we are mounting the root file system
         * read/only but we need to replay the journal; at that point,
         * for people who are east of GMT and who make their clock
         * tick in localtime for Windows bug-for-bug compatibility,
         * the clock is set in the future, and this will cause e2fsck
         * to complain and force a full file system check.
         */
        if (!(sb->s_flags & MS_RDONLY))
                es->s_wtime = cpu_to_le32(get_seconds());

Yet a dumpe2fs on my ubuntu box gives the output below. Last write
time just a half hour after the volume was created!

 Filesystem created:       Wed Nov 23 13:42:18 2011
 Last mount time:          Tue Feb 21 09:07:54 2012
 Last write time:          Wed Nov 23 14:12:57 2011

/dev/sda1 on / type ext4 (rw,errors=remount-ro,commit=0)

Linux Wallace 3.0.0-16-generic #28-Ubuntu SMP Fri Jan 27 17:44:39 UTC
2012 x86_64 x86_64 x86_64 GNU/Linux (Ubuntu 11.10)

OpenSuse and Fedora show something slightly different, but still
wrong: last write time same as last mount time.

Linux VM-OpenSUSE2 2.6.37.1-1.2-desktop #1 SMP PREEMPT 2011-02-21
10:34:10 +0100 x86_64 x86_64 x86_64 GNU/Linux (Open SUSE 11.4)

 Filesystem created:       Fri Sep 23 18:04:27 2011
 Last mount time:          Fri Jan 27 09:34:55 2012
 Last write time:          Fri Jan 27 09:34:55 2012

Linux fedoraVM 2.6.35.6-45.fc14.i686 #1 SMP Mon Oct 18 23:56:17 UTC
2010 i686 i686 i386 GNU/Linux (Fedora 14)

Filesystem created:       Wed Nov  3 07:24:17 2010
Last mount time:          Fri Feb  3 13:04:41 2012
Last write time:          Fri Feb  3 13:04:41 2012

Could someone please help me understand this? If this isn't the
correct forum to be querying apparently wayward ext4  functionality,
please point me at a better one.

Neil Clarkson
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ