--- ubd.c~ Mon May 6 10:42:56 2002 +++ ubd.c.2 Mon May 6 10:46:06 2002 @@ -720,7 +720,22 @@ end_request(0); return(1); } - + if(!dev->count) { + if (dev->file) { + if(ubd_open_dev(dev) < 0){ + printk(KERN_ERR "unable to open %s for validation\n", + dev->file); + return 1; + } + } else return 1; + + /* have to recompute sizes since we opened it */ + err = ubd_file_size(dev, &dev->size); + if(err) { + ubd_close(dev); + return 1; + } + } req->sector += ubd_part[minor].start_sect; block = req->sector; nsect = req->current_nr_sectors;