Hi Jiri,

On Thu, 3 Jan 2008, Jiri Slaby wrote:
> this happened, while playing with broken dvd.

[snip]

> Buffer I/O error on device sr0, logical block 5441
> end_request: I/O error, dev sr0, sector 136
> ISOFS: unable to read i-node block
> Unable to handle kernel NULL pointer dereference at 00000000000000ad RIP:
>  [<ffffffff802a679f>] d_splice_alias+0x1f/0x100

[snip]

> Call Trace:
>  [<ffffffff880d2395>] :isofs:isofs_lookup+0x395/0x4a0
>  [<ffffffff802a565b>] d_alloc+0x2b/0x1d0
>  [<ffffffff8029a97c>] do_lookup+0x1ac/0x200

Does the following patch fix it?

                        Pekka

[PATCH] isofs: check for bad inode in isofs_lookup
From: Pekka Enberg <[EMAIL PROTECTED]>

If isofs_read_inode() fails to read one of the inode blocks from disk, it
returns a bad inode.

Signed-off-by: Pekka Enberg <[EMAIL PROTECTED]>
---
 fs/isofs/namei.c |    5 +++++
 1 file changed, 5 insertions(+)

Index: linux-2.6/fs/isofs/namei.c
===================================================================
--- linux-2.6.orig/fs/isofs/namei.c
+++ linux-2.6/fs/isofs/namei.c
@@ -183,6 +183,11 @@ struct dentry *isofs_lookup(struct inode
                        unlock_kernel();
                        return ERR_PTR(-EACCES);
                }
+               if (is_bad_inode(inode)) {
+                       unlock_kernel();
+                       iput(inode);
+                       return ERR_PTR(-ENOENT);
+               }
        }
        unlock_kernel();
        return d_splice_alias(inode, dentry);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to