Re: mmap vs mtime in 2.6.26 and up

From: Christoph Hellwig
Date: Tue May 12 2009 - 11:53:27 EST


On Tue, May 12, 2009 at 08:37:43AM -0700, Ray Lee wrote:
> > I've noticed that the last modification times of our RRD files got
> > stuck after upgrading from 2.6.24 to 2.6.26 (Debian Etch -> Lenny; I
> > also tested with 2.6.30-rc5, they are still stuck). ??It has some
> > literature, most notably kernel bug #2645, but that's closed long ago
> > and the resulting patch http://lkml.org/lkml/2008/1/22/370 is present
> > in my kernels. ??Still, the test program (version 3 from the bug report)
> > gives failures:

The problem is pretty simple. do_wp_page and __do_fault use
file_update_time to update ctime and mtime. But this function is only
a helper for simply filesystems that have a binary inode dirty/non dirty
state and keep the m/ctime purely in the Linux inode. It must not be
called from generic code as more complex filesystems need a notification
through ->setattr to update the timestamps. This will also affect other
filesystems like ubifs. I'm not entirely sure why it ever worked
before, we must have picked up those c/mtime updates by accident
somehow.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/