Commit 8dde0509e74ff6044cf1788c917a22facce9f68d

Authored by Andrew Morton
Committed by Linus Torvalds
1 parent d4f7796e9b

[PATCH] ramfs: update dir mtime and ctime

Phil Marek <philipp.marek@bmlv.gv.at> points out that ramfs forgets to update
a directory's mtime and ctime when it is modified.

Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

Showing 1 changed file with 2 additions and 0 deletions Side-by-side Diff

... ... @@ -27,6 +27,7 @@
27 27 #include <linux/fs.h>
28 28 #include <linux/pagemap.h>
29 29 #include <linux/highmem.h>
  30 +#include <linux/time.h>
30 31 #include <linux/init.h>
31 32 #include <linux/string.h>
32 33 #include <linux/smp_lock.h>
... ... @@ -104,6 +105,7 @@
104 105 d_instantiate(dentry, inode);
105 106 dget(dentry); /* Extra count - pin the dentry in core */
106 107 error = 0;
  108 + dir->i_mtime = dir->i_ctime = CURRENT_TIME;
107 109 }
108 110 return error;
109 111 }