From: Tim Gardner <tim.gardner@canonical.com>
To: linux-kernel@vger.kernel.org
Cc: Tim Gardner <tim.gardner@canonical.com>,
Mark Fasheh <mfasheh@suse.com>, Joel Becker <jlbec@evilplan.org>,
ocfs2-devel@oss.oracle.com
Subject: [PATCH 2/2 linux-next] ocfs2: ocfs2_begin_truncate_log_recovery(): consolidate status error logging
Date: Wed, 13 Feb 2013 12:44:36 -0700 [thread overview]
Message-ID: <1360784676-74994-2-git-send-email-tim.gardner@canonical.com> (raw)
In-Reply-To: <1360784676-74994-1-git-send-email-tim.gardner@canonical.com>
Cc: Mark Fasheh <mfasheh@suse.com>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: ocfs2-devel@oss.oracle.com
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
---
fs/ocfs2/alloc.c | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/fs/ocfs2/alloc.c b/fs/ocfs2/alloc.c
index 42c0e49..1689ca1 100644
--- a/fs/ocfs2/alloc.c
+++ b/fs/ocfs2/alloc.c
@@ -6090,10 +6090,8 @@ int ocfs2_begin_truncate_log_recovery(struct ocfs2_super *osb,
trace_ocfs2_begin_truncate_log_recovery(slot_num);
status = ocfs2_get_truncate_log_info(osb, slot_num, &tl_inode, &tl_bh);
- if (status < 0) {
- mlog_errno(status);
+ if (status < 0)
goto bail;
- }
di = (struct ocfs2_dinode *) tl_bh->b_data;
@@ -6109,7 +6107,6 @@ int ocfs2_begin_truncate_log_recovery(struct ocfs2_super *osb,
*tl_copy = kmalloc(tl_bh->b_size, GFP_KERNEL);
if (!(*tl_copy)) {
status = -ENOMEM;
- mlog_errno(status);
goto bail;
}
@@ -6123,10 +6120,8 @@ int ocfs2_begin_truncate_log_recovery(struct ocfs2_super *osb,
ocfs2_compute_meta_ecc(osb->sb, tl_bh->b_data, &di->i_check);
status = ocfs2_write_block(osb, tl_bh, INODE_CACHE(tl_inode));
- if (status < 0) {
- mlog_errno(status);
+ if (status < 0)
goto bail;
- }
}
bail:
@@ -6134,6 +6129,9 @@ bail:
iput(tl_inode);
brelse(tl_bh);
+ if (status < 0)
+ mlog_errno(status);
+
kfree(*tl_copy);
*tl_copy = NULL;
--
1.7.9.5
next prev parent reply other threads:[~2013-02-13 19:45 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-13 19:44 [PATCH 1/2 linux-next] ocfs2: remove kfree() redundant null checks Tim Gardner
2013-02-13 19:44 ` Tim Gardner [this message]
2013-02-13 20:01 ` Tim Gardner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1360784676-74994-2-git-send-email-tim.gardner@canonical.com \
--to=tim.gardner@canonical.com \
--cc=jlbec@evilplan.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mfasheh@suse.com \
--cc=ocfs2-devel@oss.oracle.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®