* Re: ramfs and directory modification time
@ 2006-02-26 13:05 Chuck Ebbert
0 siblings, 0 replies; 3+ messages in thread
From: Chuck Ebbert @ 2006-02-26 13:05 UTC (permalink / raw)
To: Andrew Morton; +Cc: linux-kernel, Al Viro
In-Reply-To: <20060224040400.2f093523.akpm@osdl.org>
On Fri, 24 Feb 2006 at 04:04:00 -0800, Andrew Morton wrote:
> --- devel/fs/ramfs/inode.c~ramfs-update-dir-mtime-and-ctime 2006-02-24 03:53:46.000000000 -0800
> +++ devel-akpm/fs/ramfs/inode.c 2006-02-24 03:54:29.000000000 -0800
> @@ -27,6 +27,7 @@
> #include <linux/fs.h>
> #include <linux/pagemap.h>
> #include <linux/highmem.h>
> +#include <linux/time.h>
> #include <linux/init.h>
> #include <linux/string.h>
> #include <linux/smp_lock.h>
> @@ -104,6 +105,7 @@ ramfs_mknod(struct inode *dir, struct de
> d_instantiate(dentry, inode);
> dget(dentry); /* Extra count - pin the dentry in core */
> error = 0;
> + dir->i_mtime = dir->i_ctime = CURRENT_TIME_SEC;
> }
> return error;
> }
Shouldn't that be CURRENT_TIME?
[me@tu ramfs]$ grep -i current_time *
inode.c: inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
--
Chuck
"Equations are the Devil's sentences." --Stephen Colbert
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: ramfs and directory modification time
2006-02-23 13:05 Ph. Marek
@ 2006-02-24 12:04 ` Andrew Morton
0 siblings, 0 replies; 3+ messages in thread
From: Andrew Morton @ 2006-02-24 12:04 UTC (permalink / raw)
To: Ph. Marek; +Cc: linux-kernel
"Ph. Marek" <philipp.marek@bmlv.gv.at> wrote:
>
> I believe that I found a problem regarding ramfs and directory modification
> times.
>
>
>
> Observe:
> $ /tmp# mkdir newdir
> $ /tmp# mount -t ramfs none newdir
> $ /tmp# cd newdir/
> $ /tmp/newdir# mkdir sub
> $ /tmp/newdir# cd sub
> $ /tmp/newdir/sub# ls -la --full-time
> total 0
> drwxr-xr-x 2 root root 0 2006-02-23 14:01:37.573655160 +0100 .
> drwxr-xr-x 3 root root 0 2006-02-23 14:01:33.221316816 +0100 ..
> $ /tmp/newdir/sub# touch a-new-file
> $ /tmp/newdir/sub# ls -la --full-time
> total 0
> drwxr-xr-x 2 root root 0 2006-02-23 14:01:37.573655160 +0100 .
> drwxr-xr-x 3 root root 0 2006-02-23 14:01:33.221316816 +0100 ..
> -rw-r--r-- 1 root root 0 2006-02-23 14:01:48.019067216 +0100 a-new-file
>
> On a tmpfs or other (disk-based) filesystems (ext3) it works correctly.
Yes, bug. Thanks.
--- devel/fs/ramfs/inode.c~ramfs-update-dir-mtime-and-ctime 2006-02-24 03:53:46.000000000 -0800
+++ devel-akpm/fs/ramfs/inode.c 2006-02-24 03:54:29.000000000 -0800
@@ -27,6 +27,7 @@
#include <linux/fs.h>
#include <linux/pagemap.h>
#include <linux/highmem.h>
+#include <linux/time.h>
#include <linux/init.h>
#include <linux/string.h>
#include <linux/smp_lock.h>
@@ -104,6 +105,7 @@ ramfs_mknod(struct inode *dir, struct de
d_instantiate(dentry, inode);
dget(dentry); /* Extra count - pin the dentry in core */
error = 0;
+ dir->i_mtime = dir->i_ctime = CURRENT_TIME_SEC;
}
return error;
}
_
^ permalink raw reply [flat|nested] 3+ messages in thread
* ramfs and directory modification time
@ 2006-02-23 13:05 Ph. Marek
2006-02-24 12:04 ` Andrew Morton
0 siblings, 1 reply; 3+ messages in thread
From: Ph. Marek @ 2006-02-23 13:05 UTC (permalink / raw)
To: linux-kernel
Hello everybody,
I believe that I found a problem regarding ramfs and directory modification
times.
Observe:
$ /tmp# mkdir newdir
$ /tmp# mount -t ramfs none newdir
$ /tmp# cd newdir/
$ /tmp/newdir# mkdir sub
$ /tmp/newdir# cd sub
$ /tmp/newdir/sub# ls -la --full-time
total 0
drwxr-xr-x 2 root root 0 2006-02-23 14:01:37.573655160 +0100 .
drwxr-xr-x 3 root root 0 2006-02-23 14:01:33.221316816 +0100 ..
$ /tmp/newdir/sub# touch a-new-file
$ /tmp/newdir/sub# ls -la --full-time
total 0
drwxr-xr-x 2 root root 0 2006-02-23 14:01:37.573655160 +0100 .
drwxr-xr-x 3 root root 0 2006-02-23 14:01:33.221316816 +0100 ..
-rw-r--r-- 1 root root 0 2006-02-23 14:01:48.019067216 +0100 a-new-file
On a tmpfs or other (disk-based) filesystems (ext3) it works correctly.
Is that a design wish, that ramfs is kept as simple as possible?
Nevertheless I believe that should be fixed, as everything that relies on the
directory mtime won't work on an ramfs.
This is 2.6.26-rc4, btw, on x86.
Please CC me as I'm not subscribed (although I surely will have a look in the
archives, too).
Regards,
Phil
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2006-02-26 13:08 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-02-26 13:05 ramfs and directory modification time Chuck Ebbert
-- strict thread matches above, loose matches on Subject: below --
2006-02-23 13:05 Ph. Marek
2006-02-24 12:04 ` Andrew Morton
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).