Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 147246 Details for
Bug 227135
scsi_dump.c represents sectors using int
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Patch converting int -> sector_t in scsi_dump.c
diskdump-fix_sector.patch (text/plain), 3.29 KB, created by
Bryn M. Reeves
on 2007-02-02 19:05:05 UTC
(
hide
)
Description:
Patch converting int -> sector_t in scsi_dump.c
Filename:
MIME Type:
Creator:
Bryn M. Reeves
Created:
2007-02-02 19:05:05 UTC
Size:
3.29 KB
patch
obsolete
>diff -Nurp linux-2.6.9.org/drivers/scsi/scsi_dump.c linux-2.6.9/drivers/scsi/scsi_dump.c >--- linux-2.6.9.org/drivers/scsi/scsi_dump.c 2007-01-26 11:43:18.000000000 +0900 >+++ linux-2.6.9/drivers/scsi/scsi_dump.c 2007-01-26 11:39:42.000000000 +0900 >@@ -57,7 +57,7 @@ > #define Info(x, ...) pr_info ("scsi_dump: " x "\n", ## __VA_ARGS__) > > /* blocks to 512byte sectors */ >-#define BLOCK_SECTOR(s) ((s) << (DUMP_BLOCK_SHIFT - 9)) >+#define BLOCK_SECTOR(s) ((sector_t)((s) << (DUMP_BLOCK_SHIFT - 9))) > > static int set_wce = 1; > module_param_named(set_wce, set_wce, bool, S_IRUGO|S_IWUSR); >@@ -178,14 +178,14 @@ static void init_sense_command(struct sc > /* READ/WRITE */ > static int init_rw_command(struct disk_dump_partition *dump_part, > struct scsi_device *sdev, struct scsi_cmnd * scmd, >- int rw, int block, void *buf, unsigned int len) >+ int rw, sector_t block, void *buf, unsigned int len) > { > int this_count = len >> 9; > > memset(scmd, 0, sizeof(*scmd)); > > if (block + this_count > dump_part->nr_sects) { >- Err("block number %d is larger than %lu", >+ Err("block number %lu is larger than %lu", > block + this_count, dump_part->nr_sects); > return -EFBIG; > } >@@ -231,15 +231,36 @@ static int init_rw_command(struct disk_d > return -EINVAL; > } > >- if (this_count > 0xffff) >- this_count = 0xffff; >- >- scmd->cmnd[2] = (unsigned char) (block >> 24) & 0xff; >- scmd->cmnd[3] = (unsigned char) (block >> 16) & 0xff; >- scmd->cmnd[4] = (unsigned char) (block >> 8) & 0xff; >- scmd->cmnd[5] = (unsigned char) block & 0xff; >- scmd->cmnd[7] = (unsigned char) (this_count >> 8) & 0xff; >- scmd->cmnd[8] = (unsigned char) this_count & 0xff; >+ if (block > 0xffffffff) { >+ scmd->cmnd[0] += READ_16 - READ_10; >+ scmd->cmnd[2] = sizeof(block) > 4 ? >+ (unsigned char) (block >> 56) & 0xff : 0; >+ scmd->cmnd[3] = sizeof(block) > 4 ? >+ (unsigned char) (block >> 48) & 0xff : 0; >+ scmd->cmnd[4] = sizeof(block) > 4 ? >+ (unsigned char) (block >> 40) & 0xff : 0; >+ scmd->cmnd[5] = sizeof(block) > 4 ? >+ (unsigned char) (block >> 32) & 0xff : 0; >+ scmd->cmnd[6] = (unsigned char) (block >> 24) & 0xff; >+ scmd->cmnd[7] = (unsigned char) (block >> 16) & 0xff; >+ scmd->cmnd[8] = (unsigned char) (block >> 8) & 0xff; >+ scmd->cmnd[9] = (unsigned char) block & 0xff; >+ scmd->cmnd[10] = (unsigned char) (this_count >> 24) & 0xff; >+ scmd->cmnd[11] = (unsigned char) (this_count >> 16) & 0xff; >+ scmd->cmnd[12] = (unsigned char) (this_count >> 8) & 0xff; >+ scmd->cmnd[13] = (unsigned char) this_count & 0xff; >+ } >+ else { >+ if (this_count > 0xffff) >+ this_count = 0xffff; >+ >+ scmd->cmnd[2] = (unsigned char) (block >> 24) & 0xff; >+ scmd->cmnd[3] = (unsigned char) (block >> 16) & 0xff; >+ scmd->cmnd[4] = (unsigned char) (block >> 8) & 0xff; >+ scmd->cmnd[5] = (unsigned char) block & 0xff; >+ scmd->cmnd[7] = (unsigned char) (this_count >> 8) & 0xff; >+ scmd->cmnd[8] = (unsigned char) this_count & 0xff; >+ } > > init_scsi_command(sdev, scmd, buf, len, > (rw == WRITE ? DMA_TO_DEVICE : DMA_FROM_DEVICE), 1); >@@ -566,7 +587,7 @@ static int scsi_dump_rw_block(struct dis > { > struct disk_dump_device *dump_device = dump_part->device; > struct scsi_device *sdev = dump_device->device; >- int block_nr = BLOCK_SECTOR(dump_block_nr); >+ sector_t block_nr = BLOCK_SECTOR(dump_block_nr); > int ret; > > if (!quiesce_ok) {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 227135
: 147246 |
148883