4 Well, sometimes even the simple things don't work right. I was testing
5 this patch by forcing an -EEXIST return value from reiserfs_rename,
6 which should have stopped the entire mv operation, but somehow the
7 rename was proceeding. After leaving it alone for a bit, I did an
8 strace on mv, stupid thing unlinks the target if rename returns -EEXIST,
9 and then does a copy by hand.
11 Anyway, I think the bug you are hitting is just a symptom of a problem zam
12 found, where you've got a hidden entry lying around from some aborted
13 operations. debugreiserfs has a nifty feature that allows us to
14 corrupt blocks at will, so I added a flag that turns a visible name into
15 a hidden one and did some extra tests.
17 The short version is that instead of an oops, you should now see clm-3000
18 and zam-7002 messages in your log files. Please let me know if/when they are
23 diff -Nru a/fs/reiserfs/namei.c b/fs/reiserfs/namei.c
24 --- a/fs/reiserfs/namei.c Tue May 8 20:29:33 2001
25 +++ b/fs/reiserfs/namei.c Tue May 8 20:29:33 2001
26 @@ -1106,16 +1106,12 @@
27 retval = reiserfs_add_entry (&th, new_dir, new_dentry->d_name.name, new_dentry->d_name.len,
29 if (retval == -EEXIST) {
30 - // FIXME: is it possible, that new_inode == 0 here? If yes, it
31 - // is not clear how does ext2 handle that
33 - printk ("reiserfs_rename: new entry is found, new inode == 0\n");
35 + printk("clm-3000: name already found in dir %lu\n", new_dir->i_ino);
39 - pop_journal_writer(windex) ;
40 - journal_end(&th, old_dir->i_sb, jbegin_count) ;
45 reiserfs_update_inode_transaction(old_dir) ;
46 @@ -1250,8 +1246,11 @@
48 reiserfs_update_sd (&th, new_inode);
53 pop_journal_writer(windex) ;
54 journal_end(&th, old_dir->i_sb, jbegin_count) ;