linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@osdl.org>
To: "Ph. Marek" <philipp.marek@bmlv.gv.at>
Cc: linux-kernel@vger.kernel.org
Subject: Re: ramfs and directory modification time
Date: Fri, 24 Feb 2006 04:04:00 -0800	[thread overview]
Message-ID: <20060224040400.2f093523.akpm@osdl.org> (raw)
In-Reply-To: <200602231405.04091.philipp.marek@bmlv.gv.at>

"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;
 }
_


  reply	other threads:[~2006-02-24 12:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-23 13:05 ramfs and directory modification time Ph. Marek
2006-02-24 12:04 ` Andrew Morton [this message]
2006-02-26 13:05 Chuck Ebbert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060224040400.2f093523.akpm@osdl.org \
    --to=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=philipp.marek@bmlv.gv.at \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).