lkml.org 
[lkml]   [1997]   [Jun]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: Linux ISO9660 File System
On Sun, 29 Jun 1997, Jonathan F. Freeson wrote:

> Hello:
>
> I noticed that with some of the later 2.1.x kernels, I have been unable to
> read some of my older "Shareware" CD-ROMs that I was able to read with
> 2.0.30. With 2.1, I frequently got the kernel message:
>
> Directory entry extends past end of iso9660 block
>

Sorry for encoding the patch in base64. I had thought it would have
kept it in text format since it is a plain text file (I usually use
Netscape, not PINE). I realized this when I recieved the digest a
few minutes ago. Also, thanks to those who pointed this out to me.

Since I have this opportunity for more comments, I discovered that the
code was removed in 2.1.39. I recall that the comments for the patch
remarked about improvments to the iso9660 file system. Again, all I did
was to replace code that was removed. I hope this doesn't break anything
else (it seems to work for me).

Here it is as as part of the message.

--- namei.c.old Sun Jun 29 00:14:58 1997
+++ namei.c Sun Jun 29 00:20:33 1997
@@ -65,6 +65,7 @@
unsigned char bufbits = ISOFS_BUFFER_BITS(dir);
unsigned int block, i, f_pos, offset, inode_number;
struct buffer_head * bh;
+ void * cpnt = NULL;
unsigned int old_offset;
unsigned int backlink;
int dlen, rrflag, match;
@@ -116,8 +117,21 @@
/* Handle case where the directory entry spans two blocks.
Usually 1024 byte boundaries */
if (offset >= bufsize) {
- printk("Directory entry extends past end of iso9660 block\n");
- return 0;
+ unsigned int frag1;
+ frag1 = bufsize - old_offset;
+ cpnt = kmalloc(*((unsigned char *) de),GFP_KERNEL);
+ if (!cpnt) return 0;
+ memcpy(cpnt, bh->b_data + old_offset, frag1);
+
+ de = (struct iso_directory_record *) cpnt;
+ brelse(bh);
+ offset = f_pos & (bufsize - 1);
+ block = isofs_bmap(dir,f_pos>>bufbits);
+ if (!block || !(bh = bread(dir->i_dev,block,bufsize))) {
+ kfree(cpnt);
+ return 0;
+ };
+ memcpy((char *)cpnt+frag1, bh->b_data, offset);
}

/* Handle the '.' case */
@@ -176,6 +190,12 @@
match = isofs_match(namelen,name,dpnt,dlen);
}

+ if (cpnt)
+ {
+ kfree(cpnt);
+ cpnt = NULL;
+ }
+
if(rrflag) kfree(dpnt);
if (match) {
if(inode_number == -1) {
@@ -197,6 +217,8 @@
}
}
out:
+ if (cpnt)
+ kfree(cpnt);
brelse(bh);
return NULL;
}

----------------------

--- Jonathan F. Freeson
jfreeson@gopher.science.wayne.edu jff1@ss0.eng.wayne.edu
Homepage: http://www.science.wayne.edu/~jfreeson/index.html



\
 
 \ /
  Last update: 2005-03-22 13:39    [W:0.060 / U:0.124 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site