patch-2.3.25 linux/fs/udf/lowlevel.c

Next file: linux/fs/udf/misc.c
Previous file: linux/fs/udf/inode.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.24/linux/fs/udf/lowlevel.c linux/fs/udf/lowlevel.c
@@ -95,16 +95,17 @@
 	int ret;
 	unsigned long lblock;
 	unsigned int hbsize = get_hardblocksize(dev);
+	unsigned int secsize = 512;
 	unsigned int mult = 0;
 	unsigned int div = 0;
 
 	if (!hbsize)
-		hbsize = 512;
+		hbsize = blksize_size[MAJOR(dev)][MINOR(dev)];
 
-	if (hbsize > blksize_size[MAJOR(dev)][MINOR(dev)])
-		mult = hbsize / blksize_size[MAJOR(dev)][MINOR(dev)];
-	else if (blksize_size[MAJOR(dev)][MINOR(dev)] > hbsize)
-		div = blksize_size[MAJOR(dev)][MINOR(dev)] / hbsize;
+	if (secsize > hbsize)
+		mult = secsize / hbsize;
+	else if (hbsize > secsize)
+		div = hbsize / secsize;
 
 	if (get_blkfops(MAJOR(dev))->ioctl!=NULL)
 	{
@@ -138,7 +139,7 @@
 		}
 
 		set_fs(old_fs);
-		if (!ret)
+		if (!ret && lblock)
 			return lblock - 1;
 	}
 	else

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)