patch-2.2.14 linux/drivers/block/raid0.c

Next file: linux/drivers/block/rd.c
Previous file: linux/drivers/block/pdc4030.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.2.13/linux/drivers/block/raid0.c linux/drivers/block/raid0.c
@@ -182,6 +182,12 @@
   block=*rsector >> 1;
   hash=data->hash_table+(block/data->smallest->size);
 
+  if (hash - data->hash_table > data->nr_zones) 
+  { 
+	  printk(KERN_DEBUG "raid0_map: invalid block %ul\n", block);
+	  return -1;
+  }
+
   /* Sanity check */
   if ((chunk_size*2)<(*rsector % (chunk_size*2))+size)
   {

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