]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
[PATCH] tmpfs: time granularity fix for [acm]time going backwards
authorRobin H. Johnson <robbat2@gentoo.org>
Tue, 13 Jun 2006 17:06:11 +0000 (18:06 +0100)
committerChris Wright <chrisw@sous-sol.org>
Thu, 22 Jun 2006 19:16:12 +0000 (12:16 -0700)
I noticed a strange behavior in a tmpfs file system the other day, while
building packages - occasionally, and seemingly at random, make decided to
rebuild a target. However, only on tmpfs.

A file would be created, and if checked, it had a sub-second timestamp.
However, after an utimes related call where sub-seconds should be set, they
were zeroed instead. In the case that a file was created, and utimes(...,NULL)
was used on it in the same second, the timestamp on the file moved backwards.

After some digging, I found that this was being caused by tmpfs not having a
time granularity set, thus inheriting the default 1 second granularity.

Hugh adds: yes, we missed tmpfs when the s_time_gran mods went into 2.6.11.
Unfortunately, the granularity of CURRENT_TIME, often used in filesystems,
does not match the default granularity set by alloc_super.  A few more such
discrepancies have been found, but this is the most important to fix now.

Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
Acked-by: Andi Kleen <ak@suse.de>
Signed-off-by: Hugh Dickins <hugh@veritas.com>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/parport/Kconfig
mm/shmem.c

index f63c387976cf378a6f8ce78491a3d8de0f9a1c7c..6c8452ede0e113c4c50c6a29620ba7adbb9391db 100644 (file)
@@ -48,7 +48,7 @@ config PARPORT_PC
 
 config PARPORT_SERIAL
        tristate "Multi-IO cards (parallel and serial)"
-       depends on SERIAL_8250 && PARPORT_PC && PCI
+       depends on SERIAL_8250_PCI && PARPORT_PC && PCI
        help
          This adds support for multi-IO PCI cards that have parallel and
          serial ports.  You should say Y or M here.  If you say M, the module
index f0eb2f265ebee4723a6371d6b3c46270078db2bb..1bc2285f74693d821e5d63e3cfed5856a9df2a2e 100644 (file)
@@ -2100,6 +2100,7 @@ static int shmem_fill_super(struct super_block *sb,
        sb->s_blocksize_bits = PAGE_CACHE_SHIFT;
        sb->s_magic = TMPFS_MAGIC;
        sb->s_op = &shmem_ops;
+       sb->s_time_gran = 1;
 
        inode = shmem_get_inode(sb, S_IFDIR | mode, 0);
        if (!inode)