public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: ebiederm@xmission.com (Eric W. Biederman)
To: Jim Meyering <jim@meyering.net>
Cc: Nilmoni Deb <ndeb@ece.cmu.edu>,
	viro@math.psu.edu, bug-fileutils@gnu.org, Remy.Card@linux.org,
	linux-kernel@vger.kernel.org
Subject: Re: fs/ext2/namei.c: dir link/unlink bug? [Re: mv changes dir timestamp
Date: 30 Sep 2001 12:58:18 -0600	[thread overview]
Message-ID: <m1g0944ib9.fsf@frodo.biederman.org> (raw)
In-Reply-To: <Pine.LNX.3.96L.1010929125713.27868A-100000@d-alg.ece.cmu.edu> <87bsjt59jb.fsf@pixie.eng.ascend.com>
In-Reply-To: <87bsjt59jb.fsf@pixie.eng.ascend.com>

Jim Meyering <jim@meyering.net> writes:

> Nilmoni Deb <ndeb@ece.cmu.edu> wrote:
> > When I move a directory its time stamp gets changed.
> > I am using mv version 4.1 (with mandrake-8.1).
> 
> Thanks a lot for reporting that!
> This appears to be a bug not in GNU mv, nor even in GNU libc, but
> rather in the underlying implementation in the kernel ext2 file system
> support.  The offending change seems to have come in with a rewrite
> of fs/ext2/namei.c that happened sometime between 2.4.4 and 2.4.9.
> 
> That file begins with this new comment:
> 
>  * Rewrite to pagecache. Almost all code had been changed, so blame me
>  * if the things go wrong. Please, send bug reports to viro@math.psu.edu
> 
> This demonstrates that the problem affects ext2, but not tmpfs
> using a 2.4.10 kernel (notice that the timestamp doesn't change
> in /t, but does in the ext2 /tmp):

This actually looks like a fix.  Ext2 keeps a directory entry named
.. in the directory so it knows what the parent directory is.
So to rename a directory besides it must unlink(..) and the link(..) inside
the directory being moved, at least logically.  In the case you gave
as the parent directory didn't change it could be optimized out, but
it probably isn't worth it. 

I know this is different but why is this a problem?

Eric





  reply	other threads:[~2001-09-30 19:08 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <Pine.LNX.3.96L.1010929125713.27868A-100000@d-alg.ece.cmu.edu>
2001-09-30  9:10 ` fs/ext2/namei.c: dir link/unlink bug? [Re: mv changes dir timestamp Jim Meyering
2001-09-30 18:58   ` Eric W. Biederman [this message]
2001-09-30 20:16     ` Nilmoni Deb
2001-10-01  8:25       ` Eric W. Biederman
2001-10-01 19:13         ` Nilmoni Deb
2001-10-02  3:06           ` Eric W. Biederman
2001-10-04  6:32         ` Bob Proulx
2001-10-04  7:50           ` Albert D. Cahalan
2001-10-04 17:24             ` Nilmoni Deb
2002-04-01  6:45     ` kernel 2.4.18 exception/bug during cd read operation Nilmoni Deb
2002-04-27 23:08   ` via82cxxx_audio bug in kernel-2.4.18 Nilmoni Deb

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=m1g0944ib9.fsf@frodo.biederman.org \
    --to=ebiederm@xmission.com \
    --cc=Remy.Card@linux.org \
    --cc=bug-fileutils@gnu.org \
    --cc=jim@meyering.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ndeb@ece.cmu.edu \
    --cc=viro@math.psu.edu \
    /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