From: Joel Becker <Joel.Becker@oracle.com>
To: ocfs2-devel@oss.oracle.com
Subject: [Ocfs2-devel] [PATCH 1/1] OCFS2: add error check for ocfs2_read_locked_inode() call
Date: Tue, 24 Feb 2009 18:17:17 -0800 [thread overview]
Message-ID: <20090225021717.GD5209@mail.oracle.com> (raw)
In-Reply-To: <200902201453.n1KEr91o011340@acsinet13.oracle.com>
On Fri, Feb 20, 2009 at 10:52:01PM +0800, wengang wang wrote:
> add error check for ocfs2_read_locked_inode() call.
This isn't needed, because every error in
ocfs2_read_locked_inode() will set the inode bad with make_bad_inode().
ocfs2_iget() checks tat five lines later with is_bad_inode().
Joel
>
> Signed-off-by: Wengang Wang <wen.gang.wang@oracle.com>
> --
> Index: inode.c
> ===================================================================
> --- inode.c (revision 149)
> +++ inode.c (working copy)
> @@ -118,6 +118,7 @@ struct inode *ocfs2_iget(struct ocfs2_su
> struct inode *inode = NULL;
> struct super_block *sb = osb->sb;
> struct ocfs2_find_inode_args args;
> + int status;
>
> mlog_entry("(blkno = %llu)\n", (unsigned long long)blkno);
>
> @@ -142,7 +143,12 @@ struct inode *ocfs2_iget(struct ocfs2_su
> * afterwards. */
> if (inode && inode->i_state & I_NEW) {
> mlog(0, "Inode was not in inode cache, reading it.\n");
> - ocfs2_read_locked_inode(inode, &args);
> + status = ocfs2_read_locked_inode(inode, &args);
> + if (status) {
> + iput(inode);
> + inode = ERR_PTR(status);
> + goto bail;
> + }
> unlock_new_inode(inode);
> }
> if (inode == NULL) {
>
> _______________________________________________
> Ocfs2-devel mailing list
> Ocfs2-devel at oss.oracle.com
> http://oss.oracle.com/mailman/listinfo/ocfs2-devel
--
"In the room the women come and go
Talking of Michaelangelo."
Joel Becker
Principal Software Developer
Oracle
E-mail: joel.becker at oracle.com
Phone: (650) 506-8127
next prev parent reply other threads:[~2009-02-25 2:17 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-20 14:52 [Ocfs2-devel] [PATCH 1/1] OCFS2: add error check for ocfs2_read_locked_inode() call wengang wang
2009-02-25 2:17 ` Joel Becker [this message]
-- strict thread matches above, loose matches on Subject: below --
2009-02-20 15:05 wengang wang
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=20090225021717.GD5209@mail.oracle.com \
--to=joel.becker@oracle.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.