All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Howells <dhowells@redhat.com>
To: Al Viro <viro@ZenIV.linux.org.uk>
Cc: dhowells@redhat.com, Dave Young <hidave.darkstar@gmail.com>,
	Jiri Slaby <jirislaby@gmail.com>,
	linux-kernel@vger.kernel.org,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: isofs oops - d_splice_alias+0x1f (2.6.24-rc5-mm1)
Date: Fri, 04 Jan 2008 12:24:01 +0000	[thread overview]
Message-ID: <22924.1199449441@redhat.com> (raw)
In-Reply-To: <20080104112642.GY27894@ZenIV.linux.org.uk>

Al Viro <viro@ZenIV.linux.org.uk> wrote:

> Not enough.  isofs_iget() still can return NULL; that needs to be converted to
> ERR_PTR().
> 
> BTW, ERR_CAST is there for purpose...

This patch should probably be added on top of that one.

David
---
IGET: Add another couple of fixes to ISOFS error handling

From: David Howells <dhowells@redhat.com>

Add some more fixes to ISOFS error handling on top of Al Viro's patch:

 (1) Use IS_ERR() rather than ERR_PTR() to test for errors.

 (2) Return the error from isofs_iget() in parse_rock_ridge_inode_internal().

 (3) In isofs_export_get_parent() return -ENOMEM if that was the error rather
     than -EACCES.  Should we return -EIO if that is the error rather than
     -EACCES?

Signed-off-by: David Howells <dhowells@redhat.com>
---

 fs/isofs/export.c |    8 +++++---
 fs/isofs/namei.c  |    2 +-
 fs/isofs/rock.c   |    4 +++-
 3 files changed, 9 insertions(+), 5 deletions(-)


diff --git a/fs/isofs/export.c b/fs/isofs/export.c
index 63a2113..bb21913 100644
--- a/fs/isofs/export.c
+++ b/fs/isofs/export.c
@@ -26,7 +26,7 @@ isofs_export_iget(struct super_block *sb,
 	if (block == 0)
 		return ERR_PTR(-ESTALE);
 	inode = isofs_iget(sb, block, offset);
-	if (ERR_PTR(inode))
+	if (IS_ERR(inode))
 		return ERR_CAST(inode);
 	if (generation && inode->i_generation != generation) {
 		iput(inode);
@@ -108,8 +108,10 @@ static struct dentry *isofs_export_get_parent(struct dentry *child)
 	parent_inode = isofs_iget(child_inode->i_sb,
 				  parent_block,
 				  parent_offset);
-	if (ERR_PTR(parent_inode)) {
-		rv = ERR_PTR(-EACCES);
+	if (IS_ERR(parent_inode)) {
+		rv = ERR_CAST(parent_inode);
+		if (rv != ERR_PTR(-ENOMEM))
+			rv = ERR_PTR(-EACCES);
 		goto out;
 	}
 
diff --git a/fs/isofs/namei.c b/fs/isofs/namei.c
index beee021..344b247 100644
--- a/fs/isofs/namei.c
+++ b/fs/isofs/namei.c
@@ -179,7 +179,7 @@ struct dentry *isofs_lookup(struct inode *dir, struct dentry *dentry, struct nam
 	inode = NULL;
 	if (found) {
 		inode = isofs_iget(dir->i_sb, block, offset);
-		if (ERR_PTR(inode)) {
+		if (IS_ERR(inode)) {
 			unlock_kernel();
 			return ERR_CAST(inode);
 		}
diff --git a/fs/isofs/rock.c b/fs/isofs/rock.c
index c62b650..6bd48f0 100644
--- a/fs/isofs/rock.c
+++ b/fs/isofs/rock.c
@@ -474,8 +474,10 @@ repeat:
 			    isofs_iget(inode->i_sb,
 				       ISOFS_I(inode)->i_first_extent,
 				       0);
-			if (ERR_PTR(reloc))
+			if (IS_ERR(reloc)) {
+				ret = PTR_ERR(reloc);
 				goto out;
+			}
 			inode->i_mode = reloc->i_mode;
 			inode->i_nlink = reloc->i_nlink;
 			inode->i_uid = reloc->i_uid;

  reply	other threads:[~2008-01-04 12:24 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-03 13:23 isofs oops - d_splice_alias+0x1f (2.6.24-rc5-mm1) Jiri Slaby
2008-01-03 13:51 ` Pekka J Enberg
2008-01-03 14:11   ` Ingo Molnar
2008-01-03 14:14     ` Al Viro
2008-01-03 14:11   ` Al Viro
2008-01-03 14:15   ` Jiri Slaby
2008-01-04 10:47     ` Al Viro
2008-01-04 11:13       ` Dave Young
2008-01-04 11:25         ` Dave Young
2008-01-04 11:26         ` Al Viro
2008-01-04 12:24           ` David Howells [this message]
2008-01-04 12:35             ` Al Viro
2008-01-04 12:43               ` David Howells
2008-01-04 13:29                 ` Ingo Molnar
2008-01-03 14:10 ` Al Viro
2008-01-05  9:31   ` Andrew Morton
2008-01-05  9:46     ` Al Viro

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=22924.1199449441@redhat.com \
    --to=dhowells@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=hidave.darkstar@gmail.com \
    --cc=jirislaby@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@ZenIV.linux.org.uk \
    /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.