ia64/xen-unstable
changeset 858:3d330e41f41c latest-semistable split-1.1
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.
xeno.c, xl_block.c:
Make Xenolinux a bit noisier on blkdev errors. Properly mark read-only partitions as such, to avoid disappearing files.
author | kaf24@scramble.cl.cam.ac.uk |
---|---|
date | Tue Oct 28 20:59:14 2003 +0000 (2003-10-28) |
parents | 4a6a4b1ae475 |
children | 76ab89d1d22d |
files | xenolinux-2.4.22-sparse/arch/xeno/drivers/block/xl_block.c xenolinux-2.4.22-sparse/fs/partitions/xeno.c |
line diff
1.1 --- a/xenolinux-2.4.22-sparse/arch/xeno/drivers/block/xl_block.c Tue Oct 28 14:30:04 2003 +0000 1.2 +++ b/xenolinux-2.4.22-sparse/arch/xeno/drivers/block/xl_block.c Tue Oct 28 20:59:14 2003 +0000 1.3 @@ -495,8 +495,8 @@ static void xlblk_response_int(int irq, 1.4 case XEN_BLOCK_READ: 1.5 case XEN_BLOCK_WRITE: 1.6 if ( bret->status ) 1.7 - DPRINTK("Bad return from blkdev data request: %lx\n", 1.8 - bret->status); 1.9 + printk("Bad return from blkdev data request: %lx\n", 1.10 + bret->status); 1.11 for ( bh = (struct buffer_head *)bret->id; 1.12 bh != NULL; 1.13 bh = next_bh )
2.1 --- a/xenolinux-2.4.22-sparse/fs/partitions/xeno.c Tue Oct 28 14:30:04 2003 +0000 2.2 +++ b/xenolinux-2.4.22-sparse/fs/partitions/xeno.c Tue Oct 28 20:59:14 2003 +0000 2.3 @@ -24,7 +24,7 @@ int xeno_partition(struct gendisk *hd, 2.4 int i, minor; 2.5 2.6 /* Privileged domains can read partition info themselves. */ 2.7 - if (start_info.flags & SIF_PRIVILEGED) 2.8 + if ( start_info.flags & SIF_PRIVILEGED ) 2.9 return 0; 2.10 2.11 /* This only deals with raw/direct devices (IDE & SCSI). */ 2.12 @@ -56,6 +56,13 @@ int xeno_partition(struct gendisk *hd, 2.13 if ( (buf->entries[i].device == xldev_to_physdev(bdev->bd_dev)) && 2.14 (buf->entries[i].partition == 0) ) 2.15 { 2.16 + if ( !(buf->entries[i].mode & PHYSDISK_MODE_W) ) 2.17 + { 2.18 + if ( !(buf->entries[i].mode & PHYSDISK_MODE_R) ) 2.19 + continue; 2.20 + for ( i = 0; i < hd->max_p; i++ ) 2.21 + set_device_ro(bdev->bd_dev + i, 1); 2.22 + } 2.23 kfree(buf); 2.24 return 0; 2.25 } 2.26 @@ -66,11 +73,11 @@ int xeno_partition(struct gendisk *hd, 2.27 { 2.28 if (buf->entries[i].device != xldev_to_physdev(bdev->bd_dev)) 2.29 continue; 2.30 - if (!(buf->entries[i].mode & PHYSDISK_MODE_W)) 2.31 + if ( !(buf->entries[i].mode & PHYSDISK_MODE_W) ) 2.32 { 2.33 - if (!(buf->entries[i].mode & PHYSDISK_MODE_R)) 2.34 + if ( !(buf->entries[i].mode & PHYSDISK_MODE_R) ) 2.35 continue; 2.36 - set_device_ro(bdev->bd_dev, 1); 2.37 + set_device_ro(bdev->bd_dev + buf->entries[i].partition, 1); 2.38 } 2.39 minor = buf->entries[i].partition + first_part_minor - 1; 2.40 add_gd_partition(hd,