Allowed to suppress error message from failed burn_read_data()

This commit is contained in:
Thomas Schmitt 2007-08-23 15:02:55 +00:00
parent 64352b61ea
commit d8399cc8c9
3 changed files with 16 additions and 2 deletions

View File

@ -1872,7 +1872,9 @@ int burn_random_access_write(struct burn_drive *d, off_t byte_address,
@param data_size The amount of data to be read. This does not have to
be aligned to any block size.
@param data_count The amount of data actually read (interesting on error)
@param flag Bitfield for control purposes: (unused yet, submit 0)
@param flag Bitfield for control purposes:
bit0= - reserved -
bit1= do not submit error message if read error
@return 1=sucessful , <=0 an error occured
*/
int burn_read_data(struct burn_drive *d, off_t byte_address,

View File

@ -2823,7 +2823,8 @@ int mmc_read_10(struct burn_drive *d, int start,int amount, struct buffer *buf)
"SCSI error on read_10(%d,%d): key=%X asc=%2.2Xh ascq=%2.2Xh",
start, amount,
c.sense[2],c.sense[12],c.sense[13]);
libdax_msgs_submit(libdax_messenger, d->global_index,
if(!d->silent_on_scsi_error)
libdax_msgs_submit(libdax_messenger, d->global_index,
0x00020144,
LIBDAX_MSGS_SEV_SORRY, LIBDAX_MSGS_PRIO_HIGH,
msg, 0, 0);

View File

@ -293,10 +293,13 @@ int burn_read_data(struct burn_drive *d, off_t byte_address,
char data[], off_t data_size, off_t *data_count, int flag)
{
int alignment = 2048, start, upto, chunksize = 1, err, cpy_size, i;
int sose_mem = 0;
char msg[81], *wpt;
struct buffer buf;
*data_count = 0;
sose_mem = d->silent_on_scsi_error;
if (d->released) {
libdax_msgs_submit(libdax_messenger,
d->global_index, 0x00020142,
@ -337,11 +340,19 @@ int burn_read_data(struct burn_drive *d, off_t byte_address,
cpy_size = 16 * 2048;
} else
cpy_size = data_size - *data_count;
if (flag & 2)
d->silent_on_scsi_error = 1;
err = d->read_10(d, start, chunksize, d->buffer);
if (flag & 2)
d->silent_on_scsi_error = sose_mem;
if (err == BE_CANCELLED) {
/* Try to read a smaller part of the chunk */
for (i = 0; i < chunksize - 1; i++) {
if (flag & 2)
d->silent_on_scsi_error = 1;
err = d->read_10(d, start + i, 1, d->buffer);
if (flag & 2)
d->silent_on_scsi_error = sose_mem;
if (err == BE_CANCELLED)
break;
memcpy(wpt, d->buffer->data, 2048);