Skip to contentSkip to conversation

ReiserFS patch for updating ctimes of renamed files

DISCUSSION Anton Ertl 3 participants 4 messages Oct 14, 2003 – Oct 25, 2003 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Anton Ertl

author
#1 lore raw

Hans Reiser:

Quoted 5 lines
Quoted 3 lines · Andrew Morton

Yes, John has a point but we're not going to go and change all the other filesystems (are we?).

why not? It is correct therefor....

Many years ago we had the same problem with ext2: it did not change ctime on rename, so GNU tar did not pick up the renamed files on incremental backup. Fortunately a few kernel versions later ext2 changed to the current behaviour (unfortunately I don't remember the kernel version).

IIRC our sysadmin submitted a bug report for GNU tar at the time, and got the answer that GNU tar would not change.

- anton

Signature · 3 lines
M. Anton Ertl                    Some things have to be seen to be believed
[email protected] Most things have to be believed to be seen
http://www.complang.tuwien.ac.at/anton/home.html
#2 lore raw

I looked again at the definition of the difference between ctime and mtime on the stat man page, and I think that updating ctime in response to rename is as reasonable as updating it in response to changing the number of links.

Ok, we will conform, and I will accept the kindly donated patch, along with Andrew's optimization of our evaluation of CURRENT_TIME. vs, please add Andrew's suggested optimization and sent the result through QA. Thanks to all for your good advice.

Signature · 1 line
Hans
#3 lore raw

Great. Thanks a lot!

Where would I be able to download the patch that you guys will be producing once it's through QA? At ftp://ftp.namesys.com/pub/reiserfs-for-2.4/ or is there some other place I can get it (e.g. BK/CVS/HTTP/FTP) before it's posted at that link?

Thanks,

Alex

-----Original Message-----
From: [email protected] [mailto:[email protected]]On Behalf Of Hans Reiser
Sent: Tuesday, October 14, 2003 3:41 AM
To: Anton Ertl
Cc: [email protected]; Andrew Morton; [email protected]; jw schultz; Alex Adriaanse
Subject: Re: ReiserFS patch for updating ctimes of renamed files

I looked again at the definition of the difference between ctime and mtime on the stat man page, and I think that updating ctime in response to rename is as reasonable as updating it in response to changing the number of links.

Ok, we will conform, and I will accept the kindly donated patch, along with Andrew's optimization of our evaluation of CURRENT_TIME. vs, please add Andrew's suggested optimization and sent the result through QA. Thanks to all for your good advice.

--
Hans

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

#4 lore raw
In reply to Hans Reiser

Hi Hans,

I updated my patch to include Andrew's suggestion of eliminating extra calls to CURRENT_TIME. I also finally got a chance to test it out, and it seems to work. After applying this patch, ctime gets updated after a rename, and GNU tar now backs things up properly. I also could not detect any filesystem corruption after doing some renames.

Alex

reiserfs/namei.c Fri Oct 24 17:16:33 2003 renamed from reiserfs/namei.c.orig Mon Aug 25 06:44:43 2003 +5 -3
@@ -1205,8 +1205,11 @@
 
     mark_de_hidden (old_de.de_deh + old_de.de_entry_num);
     journal_mark_dirty (&th, old_dir->i_sb, old_de.de_bh);
-    old_dir->i_ctime = old_dir->i_mtime = CURRENT_TIME;
-    new_dir->i_ctime = new_dir->i_mtime = CURRENT_TIME;
+    ctime = CURRENT_TIME;
+    old_dir->i_ctime = old_dir->i_mtime = ctime;
+    new_dir->i_ctime = new_dir->i_mtime = ctime;
+    old_inode->i_ctime = ctime;
+    reiserfs_update_sd (&th, old_inode);
 
     if (new_dentry_inode) {
        // adjust link number of the victim
@@ -1215,7 +1218,6 @@
        } else {
            new_dentry_inode->i_nlink--;
        }
-       ctime = CURRENT_TIME;
        new_dentry_inode->i_ctime = ctime;
        savelink = new_dentry_inode->i_nlink;
     }