Mailinglist Archive: opensuse (2459 mails)

< Previous Next >
Re: [opensuse] mv and cpio have new behavior. How do I get the old back?
  • From: Sam Clemens <clemens.sam1@xxxxxxxxx>
  • Date: Tue, 25 Mar 2008 23:37:52 -0400
  • Message-id: <47E9C510.8020208@xxxxxxxxx>
Anders Johansson wrote:
On Tue, 2008-03-25 at 20:26 -0600, Boyd Lynn Gerber wrote:
The directories *are* changing. Specifically, the .. dentry is changed
to point to the inode of the new parent directory. In your ls output I'm
willing to bet that you moved the directory to another partition, which
means your directory got a new inode number, which in turn means all ..
dentries in all subdirectories had to be updated

So to my mind it is correct that the mtime gets updated. I see it more
as a problem with ext that it doesn't get updated there
They did not change partitions. They were all in /home/zenez/ This
directory was getting to many directories to follow. I did the

mkdir etc-new
mv etc etc.* etc-new/
mv etc-new etc

The above was the result.

Ah, ok, I thought you were showing the contents of the moved directory.

Well then my theory above still holds. All directories had to have an
updated .. dentry, which means they were modified

if (new_parent && src_is_directory) {
* Rewrite the ".." entry to point to the new
* directory.
error = xfs_dir_replace(tp, src_ip, "..", 2,
&first_block, &free_list,
ASSERT(error != EEXIST);
if (error)
goto abort_return;
xfs_ichgtime(src_ip, XFS_ICHGTIME_MOD |

is the code in xfs that does it. So if it gets a new .., update MOD
(mtime) and CHG (ctime). The corresponding code in ext3 is

old_inode->i_ctime = CURRENT_TIME_SEC;

so it only changes the ctime.

In other words, it is a conscious choice by the xfs programmers, and
while it's unfortunate that the file systems behave differently, I still
think xfs got it right here, because the directory is modified

Probably breaking a lot of scripts in the process, merely
because .. has an inconsequential change.

In theory correct, but in practice, wrong.

Not smart!
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse+help@xxxxxxxxxxxx

< Previous Next >