patch-2.0.37 linux/fs/isofs/inode.c

Next file: linux/fs/locks.c
Previous file: linux/fs/ioctl.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.0.36/linux/fs/isofs/inode.c linux/fs/isofs/inode.c
@@ -32,6 +32,13 @@
  */
 #define IGNORE_WRONG_MULTI_VOLUME_SPECS
 
+/*
+ * A home-burnt Joliet level 3 cd-rom with a 100 MB zip file had more than
+ * 100 file sections, so the limit should be larger than that.  What does the
+ * ISO9660 standard say?  (Ulrik Dickow <ukd@kampsax.dk>)
+ */
+#define MAX_FILE_SECTIONS 1000
+
 #ifdef LEAK_CHECK
 static int check_malloc = 0;
 static int check_bread = 0;
@@ -547,12 +554,17 @@
 		return NULL;
 	}
 
+#ifdef DO_FUNKY_BROKEN_MEDIA_CHANGE_CHECK
 	if(!check_disk_change(s->s_dev)) {
 		return s;
 	}
 	if (s->u.isofs_sb.s_nls_iocharset)
 		unload_nls(s->u.isofs_sb.s_nls_iocharset);
 	if (opt.iocharset) kfree(opt.iocharset);
+#else
+	check_disk_change(s->s_dev);
+	return s;
+#endif	
 
  out: /* Kick out for various error conditions */
 	brelse(bh);
@@ -646,8 +658,9 @@
 			nextino = ino->u.isofs_i.i_next_section_ino;
 			iput(ino);
 		
-			if(++i > 100) {
-				printk("isofs_bmap: More than 100 file sections ?!?, aborting...\n");
+			if(++i > MAX_FILE_SECTIONS) {
+				printk("isofs_bmap: More than %d file sections ?!?, aborting...\n",
+				       MAX_FILE_SECTIONS);
 				printk("isofs_bmap: ino=%lu block=%d firstext=%u size=%u nextino=%lu\n",
 				       inode->i_ino, block, firstext, (unsigned)size, nextino);
 				return 0;
@@ -688,9 +701,10 @@
 	ino = inode->i_ino;
 	i = 0;
 	do {
-		if(i > 100) {
-			printk("isofs_read_level3_size: More than 100 file sections ?!?, aborting...\n"
-			       "isofs_read_level3_size: inode=%lu ino=%lu\n", inode->i_ino, ino);
+		if(i > MAX_FILE_SECTIONS) {
+			printk("isofs_read_level3_size: More than %d file sections ?!?, aborting...\n"
+			       "isofs_read_level3_size: inode=%lu ino=%lu\n", MAX_FILE_SECTIONS,
+			       inode->i_ino, ino);
 			return 0;
 		}
 
@@ -824,8 +838,9 @@
 	}
 
 	/* There are defective discs out there - we do this to protect
-	   ourselves.  A cdrom will never contain more than 800Mb */
-	if((inode->i_size < 0 || inode->i_size > 800000000) &&
+	   ourselves.  A cdrom will never contain more than 800Mb 
+	   Allow 1Gig for DVD however - Ulrich Habel */
+	if((inode->i_size < 0 || inode->i_size > 1073741824) &&
 	    inode->i_sb->u.isofs_sb.s_cruft == 'n') {
 	  printk("Warning: defective cdrom.  Enabling \"cruft\" mount option.\n");
 	  inode->i_sb->u.isofs_sb.s_cruft = 'y';

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov