summaryrefslogtreecommitdiffstats
path: root/fs/jffs2/gc.c
diff options
context:
space:
mode:
authorArtem B. Bityutskiy <dedekind@infradead.org>2005-08-17 14:46:26 +0100
committerThomas Gleixner <tglx@mtd.linutronix.de>2005-11-06 20:25:59 +0100
commit3a69e0cd22cf34920508a4032d53e41251925f53 (patch)
treef6f862aa743e3de98e348c20d84a26772da06195 /fs/jffs2/gc.c
parent01d445f89d68187c9ada7b58ca939dbb987c9fbd (diff)
downloadlinux-3a69e0cd22cf34920508a4032d53e41251925f53.tar.gz
linux-3a69e0cd22cf34920508a4032d53e41251925f53.tar.bz2
linux-3a69e0cd22cf34920508a4032d53e41251925f53.zip
[JFFS2] Fix JFFS2 [mc]time handling
From: David Woodhouse <dwmw2@infradead.org> Signed-off-by: Artem B. Bityutskiy <dedekind@infradead.org> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'fs/jffs2/gc.c')
-rw-r--r--fs/jffs2/gc.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/fs/jffs2/gc.c b/fs/jffs2/gc.c
index 362cfeed7327..def97157ecbd 100644
--- a/fs/jffs2/gc.c
+++ b/fs/jffs2/gc.c
@@ -7,7 +7,7 @@
*
* For licensing information, see the file 'LICENCE' in this directory.
*
- * $Id: gc.c,v 1.152 2005/07/24 15:14:14 dedekind Exp $
+ * $Id: gc.c,v 1.153 2005/08/17 13:46:22 dedekind Exp $
*
*/
@@ -771,7 +771,12 @@ static int jffs2_garbage_collect_dirent(struct jffs2_sb_info *c, struct jffs2_er
rd.pino = cpu_to_je32(f->inocache->ino);
rd.version = cpu_to_je32(++f->highest_version);
rd.ino = cpu_to_je32(fd->ino);
- rd.mctime = cpu_to_je32(max(JFFS2_F_I_MTIME(f), JFFS2_F_I_CTIME(f)));
+ /* If the times on this inode were set by explicit utime() they can be different,
+ so refrain from splatting them. */
+ if (JFFS2_F_I_MTIME(f) == JFFS2_F_I_CTIME(f))
+ rd.mctime = cpu_to_je32(JFFS2_F_I_MTIME(f));
+ else
+ rd.mctime = cpu_to_je32(0);
rd.type = fd->type;
rd.node_crc = cpu_to_je32(crc32(0, &rd, sizeof(rd)-8));
rd.name_crc = cpu_to_je32(crc32(0, fd->name, rd.nsize));
@@ -883,6 +888,9 @@ static int jffs2_garbage_collect_deletion_dirent(struct jffs2_sb_info *c, struct
kfree(rd);
}
+ /* FIXME: If we're deleting a dirent which contains the current mtime and ctime,
+ we should update the metadata node with those times accordingly */
+
/* No need for it any more. Just mark it obsolete and remove it from the list */
while (*fdp) {
if ((*fdp) == fd) {