diff options
author | Wengang Wang <wen.gang.wang@oracle.com> | 2011-10-12 15:22:15 +0800 |
---|---|---|
committer | Joel Becker <jlbec@evilplan.org> | 2011-11-17 01:46:47 -0800 |
commit | b8a0ae579fb8d9b21008ac386be08b9428902455 (patch) | |
tree | cab8d712ee687c26bd2e1ce8ba7b069be4a7e92a /fs/ocfs2/xattr.c | |
parent | 8298524803339a9a8df053ebdfebc2975ec55be9 (diff) | |
download | lwn-b8a0ae579fb8d9b21008ac386be08b9428902455.tar.gz lwn-b8a0ae579fb8d9b21008ac386be08b9428902455.zip |
ocfs2: Commit transactions in error cases -v2
There are three cases found that in error cases, journal transactions are not
committed nor aborted. We should take care of these case by committing the
transactions. Otherwise, there would left a journal handle which will lead to
, in same process context, the comming ocfs2_start_trans() gets wrong credits.
Signed-off-by: Wengang Wang <wen.gang.wang@oracle.com>
Signed-off-by: Joel Becker <jlbec@evilplan.org>
Diffstat (limited to 'fs/ocfs2/xattr.c')
-rw-r--r-- | fs/ocfs2/xattr.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/fs/ocfs2/xattr.c b/fs/ocfs2/xattr.c index 81ecf9c0bf0a..93d6c80b3922 100644 --- a/fs/ocfs2/xattr.c +++ b/fs/ocfs2/xattr.c @@ -2376,16 +2376,18 @@ static int ocfs2_remove_value_outside(struct inode*inode, } ret = ocfs2_xattr_value_truncate(inode, vb, 0, &ctxt); - if (ret < 0) { - mlog_errno(ret); - break; - } ocfs2_commit_trans(osb, ctxt.handle); if (ctxt.meta_ac) { ocfs2_free_alloc_context(ctxt.meta_ac); ctxt.meta_ac = NULL; } + + if (ret < 0) { + mlog_errno(ret); + break; + } + } if (ctxt.meta_ac) |