diff options
author | Jeff Mahoney <jeffm@suse.com> | 2009-03-30 14:02:25 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-03-30 15:16:36 -0400 |
commit | c3a9c2109f84882b9b3178f6b1838d550d3df0ec (patch) | |
tree | 08a502b8013eabb562f03be45622b0f63b1a34b9 /fs/reiserfs/namei.c | |
parent | 78b6513d2881f1a759fb9825a036d926392de084 (diff) |
reiserfs: rework reiserfs_panic
ReiserFS panics can be somewhat inconsistent.
In some cases:
* a unique identifier may be associated with it
* the function name may be included
* the device may be printed separately
This patch aims to make warnings more consistent. reiserfs_warning() prints
the device name, so printing it a second time is not required. The function
name for a warning is always helpful in debugging, so it is now automatically
inserted into the output. Hans has stated that every warning should have
a unique identifier. Some cases lack them, others really shouldn't have them.
reiserfs_warning() now expects an id associated with each message. In the
rare case where one isn't needed, "" will suffice.
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/reiserfs/namei.c')
-rw-r--r-- | fs/reiserfs/namei.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/fs/reiserfs/namei.c b/fs/reiserfs/namei.c index bb41c6e7c79b..ef41cc882bd9 100644 --- a/fs/reiserfs/namei.c +++ b/fs/reiserfs/namei.c | |||
@@ -145,10 +145,9 @@ int search_by_entry_key(struct super_block *sb, const struct cpu_key *key, | |||
145 | if (!is_direntry_le_ih(de->de_ih) || | 145 | if (!is_direntry_le_ih(de->de_ih) || |
146 | COMP_SHORT_KEYS(&(de->de_ih->ih_key), key)) { | 146 | COMP_SHORT_KEYS(&(de->de_ih->ih_key), key)) { |
147 | print_block(de->de_bh, 0, -1, -1); | 147 | print_block(de->de_bh, 0, -1, -1); |
148 | reiserfs_panic(sb, | 148 | reiserfs_panic(sb, "vs-7005", "found item %h is not directory " |
149 | "vs-7005: search_by_entry_key: found item %h is not directory item or " | 149 | "item or does not belong to the same directory " |
150 | "does not belong to the same directory as key %K", | 150 | "as key %K", de->de_ih, key); |
151 | de->de_ih, key); | ||
152 | } | 151 | } |
153 | #endif /* CONFIG_REISERFS_CHECK */ | 152 | #endif /* CONFIG_REISERFS_CHECK */ |
154 | 153 | ||
@@ -1193,15 +1192,14 @@ static int entry_points_to_object(const char *name, int len, | |||
1193 | 1192 | ||
1194 | if (inode) { | 1193 | if (inode) { |
1195 | if (!de_visible(de->de_deh + de->de_entry_num)) | 1194 | if (!de_visible(de->de_deh + de->de_entry_num)) |
1196 | reiserfs_panic(NULL, | 1195 | reiserfs_panic(inode->i_sb, "vs-7042", |
1197 | "vs-7042: entry_points_to_object: entry must be visible"); | 1196 | "entry must be visible"); |
1198 | return (de->de_objectid == inode->i_ino) ? 1 : 0; | 1197 | return (de->de_objectid == inode->i_ino) ? 1 : 0; |
1199 | } | 1198 | } |
1200 | 1199 | ||
1201 | /* this must be added hidden entry */ | 1200 | /* this must be added hidden entry */ |
1202 | if (de_visible(de->de_deh + de->de_entry_num)) | 1201 | if (de_visible(de->de_deh + de->de_entry_num)) |
1203 | reiserfs_panic(NULL, | 1202 | reiserfs_panic(NULL, "vs-7043", "entry must be visible"); |
1204 | "vs-7043: entry_points_to_object: entry must be visible"); | ||
1205 | 1203 | ||
1206 | return 1; | 1204 | return 1; |
1207 | } | 1205 | } |
@@ -1315,8 +1313,8 @@ static int reiserfs_rename(struct inode *old_dir, struct dentry *old_dentry, | |||
1315 | new_dentry->d_name.len, old_inode, 0); | 1313 | new_dentry->d_name.len, old_inode, 0); |
1316 | if (retval == -EEXIST) { | 1314 | if (retval == -EEXIST) { |
1317 | if (!new_dentry_inode) { | 1315 | if (!new_dentry_inode) { |
1318 | reiserfs_panic(old_dir->i_sb, | 1316 | reiserfs_panic(old_dir->i_sb, "vs-7050", |
1319 | "vs-7050: new entry is found, new inode == 0\n"); | 1317 | "new entry is found, new inode == 0"); |
1320 | } | 1318 | } |
1321 | } else if (retval) { | 1319 | } else if (retval) { |
1322 | int err = journal_end(&th, old_dir->i_sb, jbegin_count); | 1320 | int err = journal_end(&th, old_dir->i_sb, jbegin_count); |