All of lore.kernel.org
 help / color / mirror / Atom feed
* [Ocfs2-devel] [PATCH 1/1] OCFS2: add error check for ocfs2_read_locked_inode() call
@ 2009-02-20 14:52 wengang wang
  2009-02-25  2:17 ` Joel Becker
  0 siblings, 1 reply; 3+ messages in thread
From: wengang wang @ 2009-02-20 14:52 UTC (permalink / raw)
  To: ocfs2-devel

add error check for ocfs2_read_locked_inode() call.

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) {

^ permalink raw reply	[flat|nested] 3+ messages in thread
* [Ocfs2-devel] [PATCH 1/1] OCFS2: add error check for ocfs2_read_locked_inode() call
@ 2009-02-20 15:05 wengang wang
  0 siblings, 0 replies; 3+ messages in thread
From: wengang wang @ 2009-02-20 15:05 UTC (permalink / raw)
  To: ocfs2-devel

(resend if my first attemp not failed)
add error check for ocfs2_read_locked_inode() call.

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) {

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-02-25  2:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
  -- strict thread matches above, loose matches on Subject: below --
2009-02-20 15:05 wengang wang

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.