summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorAndrew Morton <akpm@osdl.org>2003-07-17 19:25:23 -0700
committerLinus Torvalds <torvalds@home.osdl.org>2003-07-17 19:25:23 -0700
commit2e1972fa2e109548cdb324b3aca0d29096c0ef90 (patch)
tree296632276f706c95334ff077e8376bbb2488920b /fs
parent7360a4406ce90f88120f10137373d737634ae6c2 (diff)
[PATCH] ext3 extended attribute fixes
From: Andreas Gruenbacher <agruen@suse.de> - Fix transaction credit exhaustion BUG. - ext3_journal_get_write_access_credits failures break out of the loop in 1058, so <ce> is not released properly. - <credits> must be reset after journal_release_buffer() in line 1072.
Diffstat (limited to 'fs')
-rw-r--r--fs/ext3/xattr.c7
-rw-r--r--fs/jbd/transaction.c2
2 files changed, 4 insertions, 5 deletions
diff --git a/fs/ext3/xattr.c b/fs/ext3/xattr.c
index 6fbda077bdbe..66ed5a09a3e6 100644
--- a/fs/ext3/xattr.c
+++ b/fs/ext3/xattr.c
@@ -1050,12 +1050,10 @@ ext3_xattr_cache_find(handle_t *handle, struct inode *inode,
ext3_error(inode->i_sb, "ext3_xattr_cache_find",
"inode %ld: block %ld read error",
inode->i_ino, (unsigned long) ce->e_block);
- } else {
+ } else if (ext3_journal_get_write_access_credits(
+ handle, bh, credits) == 0) {
/* ext3_journal_get_write_access() requires an unlocked
* bh, which complicates things here. */
- if (ext3_journal_get_write_access_credits(handle, bh,
- credits) != 0)
- return NULL;
lock_buffer(bh);
if (le32_to_cpu(HDR(bh)->h_refcount) >
EXT3_XATTR_REFCOUNT_MAX) {
@@ -1070,6 +1068,7 @@ ext3_xattr_cache_find(handle_t *handle, struct inode *inode,
}
unlock_buffer(bh);
journal_release_buffer(handle, bh, *credits);
+ *credits = 0;
brelse(bh);
}
ce = mb_cache_entry_find_next(ce, 0, inode->i_sb->s_bdev, hash);
diff --git a/fs/jbd/transaction.c b/fs/jbd/transaction.c
index 2861ee44cb11..83de01cd53f5 100644
--- a/fs/jbd/transaction.c
+++ b/fs/jbd/transaction.c
@@ -742,7 +742,7 @@ int journal_get_write_access(handle_t *handle,
/* We do not want to get caught playing with fields which the
* log thread also manipulates. Make sure that the buffer
* completes any outstanding IO before proceeding. */
- rc = do_get_write_access(handle, jh, 0, NULL);
+ rc = do_get_write_access(handle, jh, 0, credits);
journal_put_journal_head(jh);
return rc;
}