aboutsummaryrefslogtreecommitdiffstats
path: root/fs/reiserfs
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2006-01-11 12:17:40 -0800
committerLinus Torvalds <torvalds@g5.osdl.org>2006-01-11 18:42:12 -0800
commitef43bc4fc32bec8fda7bae8948b774616dc9e496 (patch)
tree75cec437c9909f29752ad77b50fbd09af55e7817 /fs/reiserfs
parent[PATCH] synclink_gt remove unnecessary page alignment (diff)
downloadlinux-dev-ef43bc4fc32bec8fda7bae8948b774616dc9e496.tar.xz
linux-dev-ef43bc4fc32bec8fda7bae8948b774616dc9e496.zip
[PATCH] reiserfs: fix assertion failure in reiserfs+journaled quotas
Sometimes we call do_journal_end() with t_refcount == 0. If quota is turned on and we happen to have some inode with preallocation bad things happen as we try to use the current handle for quota operations. Checks for t_refcount in journal_begin() fail and we Oops. We raise t_refcount to make those checks happy. We should not cause any bad as all the needed quota blocks should be already attached to the transaction (they were attached to the transaction when we allocated those preallocation blocks). Signed-off-by: Jan Kara <jack@suse.cz> Cc: Jeff Mahoney <jeffm@suse.com> Cc: Chris Mason <mason@suse.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/reiserfs')
-rw-r--r--fs/reiserfs/journal.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/reiserfs/journal.c b/fs/reiserfs/journal.c
index 3f17ef844fb6..4491fcf2a0e6 100644
--- a/fs/reiserfs/journal.c
+++ b/fs/reiserfs/journal.c
@@ -3925,10 +3925,13 @@ static int do_journal_end(struct reiserfs_transaction_handle *th,
flush = 1;
}
#ifdef REISERFS_PREALLOCATE
- /* quota ops might need to nest, setup the journal_info pointer for them */
+ /* quota ops might need to nest, setup the journal_info pointer for them
+ * and raise the refcount so that it is > 0. */
current->journal_info = th;
+ th->t_refcount++;
reiserfs_discard_all_prealloc(th); /* it should not involve new blocks into
* the transaction */
+ th->t_refcount--;
current->journal_info = th->t_handle_save;
#endif