bitkeeper revision 1.535 (3f9ed8a2fZBk0CjxQTZazTwxPVGVjQ)

xeno.c, xl_block.c:
  Make Xenolinux a bit noisier on blkdev errors. Properly mark read-only partitions as such, to avoid disappearing files.
This commit is contained in:
kaf24@scramble.cl.cam.ac.uk committed 2003-10-28 20:59:14 +00:00
1 parent 3a82e2bb87
commit 10b248c419
2 files changed
+13 -6

No files matched your search

@@ -495,8 +495,8 @@ static void xlblk_response_int(int irq, void *dev_id, struct pt_regs *ptregs)
case XEN_BLOCK_READ:
case XEN_BLOCK_WRITE:
if ( bret->status )
DPRINTK("Bad return from blkdev data request: %lx\n",
bret->status);
printk("Bad return from blkdev data request: %lx\n",
bret->status);
for ( bh = (struct buffer_head *)bret->id;
bh != NULL;
bh = next_bh )
+11 -4
View File
@@ -24,7 +24,7 @@ int xeno_partition(struct gendisk *hd,
int i, minor;
/* Privileged domains can read partition info themselves. */
if (start_info.flags & SIF_PRIVILEGED)
if ( start_info.flags & SIF_PRIVILEGED )
return 0;
/* This only deals with raw/direct devices (IDE & SCSI). */
@@ -56,6 +56,13 @@ int xeno_partition(struct gendisk *hd,
if ( (buf->entries[i].device == xldev_to_physdev(bdev->bd_dev)) &&
(buf->entries[i].partition == 0) )
{
if ( !(buf->entries[i].mode & PHYSDISK_MODE_W) )
{
if ( !(buf->entries[i].mode & PHYSDISK_MODE_R) )
continue;
for ( i = 0; i < hd->max_p; i++ )
set_device_ro(bdev->bd_dev + i, 1);
}
kfree(buf);
return 0;
}
@@ -66,11 +73,11 @@ int xeno_partition(struct gendisk *hd,
{
if (buf->entries[i].device != xldev_to_physdev(bdev->bd_dev))
continue;
if (!(buf->entries[i].mode & PHYSDISK_MODE_W))
if ( !(buf->entries[i].mode & PHYSDISK_MODE_W) )
{
if (!(buf->entries[i].mode & PHYSDISK_MODE_R))
if ( !(buf->entries[i].mode & PHYSDISK_MODE_R) )
continue;
set_device_ro(bdev->bd_dev, 1);
set_device_ro(bdev->bd_dev + buf->entries[i].partition, 1);
}
minor = buf->entries[i].partition + first_part_minor - 1;
add_gd_partition(hd,
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.