diff options
author | kaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk> | 2003-10-28 20:59:14 +0000 |
---|---|---|
committer | kaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk> | 2003-10-28 20:59:14 +0000 |
commit | 10b248c419e429a2c0ecd4ffe2ea1f670cc19282 (patch) | |
tree | f154c9d000e91bc7cb41fe76138babf39d028109 | |
parent | 3a82e2bb87814cc06f14302486007df6ac0ca224 (diff) | |
download | xen-split-1.1.tar.gz xen-split-1.1.tar.bz2 xen-split-1.1.zip |
bitkeeper revision 1.535 (3f9ed8a2fZBk0CjxQTZazTwxPVGVjQ)split-1.1latest-semistable
xeno.c, xl_block.c:
Make Xenolinux a bit noisier on blkdev errors. Properly mark read-only partitions as such, to avoid disappearing files.
-rw-r--r-- | xenolinux-2.4.22-sparse/arch/xeno/drivers/block/xl_block.c | 4 | ||||
-rw-r--r-- | xenolinux-2.4.22-sparse/fs/partitions/xeno.c | 15 |
2 files changed, 13 insertions, 6 deletions
diff --git a/xenolinux-2.4.22-sparse/arch/xeno/drivers/block/xl_block.c b/xenolinux-2.4.22-sparse/arch/xeno/drivers/block/xl_block.c index 357c2056a6..2592b88ec3 100644 --- a/xenolinux-2.4.22-sparse/arch/xeno/drivers/block/xl_block.c +++ b/xenolinux-2.4.22-sparse/arch/xeno/drivers/block/xl_block.c @@ -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 ) diff --git a/xenolinux-2.4.22-sparse/fs/partitions/xeno.c b/xenolinux-2.4.22-sparse/fs/partitions/xeno.c index 98cd08d65a..e60fc76b5a 100644 --- a/xenolinux-2.4.22-sparse/fs/partitions/xeno.c +++ b/xenolinux-2.4.22-sparse/fs/partitions/xeno.c @@ -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, |