[PATCH] reiserfs: Debugging patch

From: Jan Kara
Date: Mon Jan 02 2012 - 06:49:06 EST


Signed-off-by: Jan Kara <jack@xxxxxxx>
---
fs/reiserfs/journal.c | 8 +++++++-
fs/reiserfs/namei.c | 7 +++++++
2 files changed, 14 insertions(+), 1 deletions(-)

diff --git a/fs/reiserfs/journal.c b/fs/reiserfs/journal.c
index eb71106..c7ff04a 100644
--- a/fs/reiserfs/journal.c
+++ b/fs/reiserfs/journal.c
@@ -3003,7 +3003,13 @@ static int do_journal_begin_r(struct reiserfs_transaction_handle *th,
int retval;

reiserfs_check_lock_depth(sb, "journal_begin");
- BUG_ON(nblocks > journal->j_trans_max);
+ if (nblocks > journal->j_trans_max) {
+ printk(KERN_ERR "Too many blocks for reiserfs a transaction"
+ " (%lu > %lu)\n", nblocks,
+ (unsigned long)journal->j_trans_max);
+ dump_stack();
+ return -EINVAL;
+ }

PROC_INFO_INC(sb, journal.journal_being);
/* set here for journal_join */
diff --git a/fs/reiserfs/namei.c b/fs/reiserfs/namei.c
index 80058e8..1a05abe 100644
--- a/fs/reiserfs/namei.c
+++ b/fs/reiserfs/namei.c
@@ -584,6 +584,7 @@ static int reiserfs_create(struct inode *dir, struct dentry *dentry, int mode,
REISERFS_QUOTA_TRANS_BLOCKS(dir->i_sb));
struct reiserfs_transaction_handle th;
struct reiserfs_security_handle security;
+ int security_ret;

dquot_initialize(dir);

@@ -598,11 +599,17 @@ static int reiserfs_create(struct inode *dir, struct dentry *dentry, int mode,
drop_new_inode(inode);
return retval;
}
+ security_ret = retval;
jbegin_count += retval;
reiserfs_write_lock(dir->i_sb);

retval = journal_begin(&th, dir->i_sb, jbegin_count);
if (retval) {
+ if (retval == -EINVAL) {
+ printk(KERN_ERR "reiserfs_security_init() returned %d"
+ " (dir=%lu)\n", security_ret, dir->i_ino);
+ BUG_ON(1);
+ }
drop_new_inode(inode);
goto out_failed;
}
--
1.7.1


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