linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* ext4 superblock last write time clearly isnt the last write time
@ 2012-02-23 21:27 Neil Clarkson
  2012-02-23 22:01 ` Andi Kleen
  2012-02-24  8:19 ` Neil Clarkson
  0 siblings, 2 replies; 3+ messages in thread
From: Neil Clarkson @ 2012-02-23 21:27 UTC (permalink / raw)
  To: linux-kernel

Isn't the s_wtime field of the ext4 superblock supposed to show the
time, in seconds since the epoch, of the last write to the file
system? All the public domain info I found seems to indicate so, as
does this excerpt of code from '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 I noticed, on the 3 systems available to me, that it isn't
anything of the sort. Using dumpe2fs -h to show the timestamp fields
in the superblock, one seems be set at a half hour post file system
creation, the others clearly mirror the last mount time. None of them
are showing the time of the last write. None of them are mounted read
only.

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)

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

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

Clearly I'm missing something? Anyone know what? I've not found any
hints so far.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: ext4 superblock last write time clearly isnt the last write time
  2012-02-23 21:27 ext4 superblock last write time clearly isnt the last write time Neil Clarkson
@ 2012-02-23 22:01 ` Andi Kleen
  2012-02-24  8:19 ` Neil Clarkson
  1 sibling, 0 replies; 3+ messages in thread
From: Andi Kleen @ 2012-02-23 22:01 UTC (permalink / raw)
  To: Neil Clarkson; +Cc: linux-kernel

Neil Clarkson <neilaclarkson@gmail.com> writes:

> Isn't the s_wtime field of the ext4 superblock supposed to show the
> time, in seconds since the epoch, of the last write to the file
> system? 

Last write to the super block. Obviously last write to the file system
would be incredible expensive: every write to the file system would
cause a super block write too, doubling all write IO.

-Andi

-- 
ak@linux.intel.com -- Speaking for myself only

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: ext4 superblock last write time clearly isnt the last write time
  2012-02-23 21:27 ext4 superblock last write time clearly isnt the last write time Neil Clarkson
  2012-02-23 22:01 ` Andi Kleen
@ 2012-02-24  8:19 ` Neil Clarkson
  1 sibling, 0 replies; 3+ messages in thread
From: Neil Clarkson @ 2012-02-24  8:19 UTC (permalink / raw)
  To: linux-kernel

If this time field is meant to be the time of the last write of the
superblock, as has been suggested to me, but which I doubt, it still
doesnt make sense. Clearly the superblock must have been rewritten
when the mount time was updated, yet on my Ubuntu box the last write
time is far older than that.

On 23 February 2012 21:27, Neil Clarkson <neilaclarkson@gmail.com> wrote:
> Isn't the s_wtime field of the ext4 superblock supposed to show the
> time, in seconds since the epoch, of the last write to the file
> system? All the public domain info I found seems to indicate so, as
> does this excerpt of code from '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 I noticed, on the 3 systems available to me, that it isn't
> anything of the sort. Using dumpe2fs -h to show the timestamp fields
> in the superblock, one seems be set at a half hour post file system
> creation, the others clearly mirror the last mount time. None of them
> are showing the time of the last write. None of them are mounted read
> only.
>
> 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)
>
> 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
>
> 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
>
> Clearly I'm missing something? Anyone know what? I've not found any
> hints so far.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-02-24  8:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-23 21:27 ext4 superblock last write time clearly isnt the last write time Neil Clarkson
2012-02-23 22:01 ` Andi Kleen
2012-02-24  8:19 ` Neil Clarkson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).