]>
Commit | Line | Data |
---|---|---|
91c1c94b JR |
1 | |
2 | [ BUG during rename ] | |
3 | ||
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. | |
10 | ||
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. | |
16 | ||
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 | |
19 | triggered. | |
20 | ||
21 | -chris | |
22 | ||
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, | |
28 | old_inode, 0); | |
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 | |
32 | if (!new_inode) { | |
33 | - printk ("reiserfs_rename: new entry is found, new inode == 0\n"); | |
34 | - BUG (); | |
35 | + printk("clm-3000: name already found in dir %lu\n", new_dir->i_ino); | |
36 | + goto error_out ; | |
37 | } | |
38 | } else if (retval) { | |
39 | - pop_journal_writer(windex) ; | |
40 | - journal_end(&th, old_dir->i_sb, jbegin_count) ; | |
41 | - return retval; | |
42 | + goto error_out ; | |
43 | } | |
44 | ||
45 | reiserfs_update_inode_transaction(old_dir) ; | |
46 | @@ -1250,8 +1246,11 @@ | |
47 | if (new_inode) | |
48 | reiserfs_update_sd (&th, new_inode); | |
49 | ||
50 | + retval = 0 ; | |
51 | + | |
52 | +error_out: | |
53 | pop_journal_writer(windex) ; | |
54 | journal_end(&th, old_dir->i_sb, jbegin_count) ; | |
55 | - return 0; | |
56 | + return retval ; | |
57 | } | |
58 | ||
59 |