Allowed to suppress error message from failed burn_read_data()
This commit is contained in:
parent
c6bc4a5e97
commit
1adf86532e
@ -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
|
@param data_size The amount of data to be read. This does not have to
|
||||||
be aligned to any block size.
|
be aligned to any block size.
|
||||||
@param data_count The amount of data actually read (interesting on error)
|
@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
|
@return 1=sucessful , <=0 an error occured
|
||||||
*/
|
*/
|
||||||
int burn_read_data(struct burn_drive *d, off_t byte_address,
|
int burn_read_data(struct burn_drive *d, off_t byte_address,
|
||||||
|
@ -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",
|
"SCSI error on read_10(%d,%d): key=%X asc=%2.2Xh ascq=%2.2Xh",
|
||||||
start, amount,
|
start, amount,
|
||||||
c.sense[2],c.sense[12],c.sense[13]);
|
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,
|
0x00020144,
|
||||||
LIBDAX_MSGS_SEV_SORRY, LIBDAX_MSGS_PRIO_HIGH,
|
LIBDAX_MSGS_SEV_SORRY, LIBDAX_MSGS_PRIO_HIGH,
|
||||||
msg, 0, 0);
|
msg, 0, 0);
|
||||||
|
@ -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)
|
char data[], off_t data_size, off_t *data_count, int flag)
|
||||||
{
|
{
|
||||||
int alignment = 2048, start, upto, chunksize = 1, err, cpy_size, i;
|
int alignment = 2048, start, upto, chunksize = 1, err, cpy_size, i;
|
||||||
|
int sose_mem = 0;
|
||||||
char msg[81], *wpt;
|
char msg[81], *wpt;
|
||||||
struct buffer buf;
|
struct buffer buf;
|
||||||
|
|
||||||
*data_count = 0;
|
*data_count = 0;
|
||||||
|
sose_mem = d->silent_on_scsi_error;
|
||||||
|
|
||||||
if (d->released) {
|
if (d->released) {
|
||||||
libdax_msgs_submit(libdax_messenger,
|
libdax_msgs_submit(libdax_messenger,
|
||||||
d->global_index, 0x00020142,
|
d->global_index, 0x00020142,
|
||||||
@ -337,11 +340,19 @@ int burn_read_data(struct burn_drive *d, off_t byte_address,
|
|||||||
cpy_size = 16 * 2048;
|
cpy_size = 16 * 2048;
|
||||||
} else
|
} else
|
||||||
cpy_size = data_size - *data_count;
|
cpy_size = data_size - *data_count;
|
||||||
|
if (flag & 2)
|
||||||
|
d->silent_on_scsi_error = 1;
|
||||||
err = d->read_10(d, start, chunksize, d->buffer);
|
err = d->read_10(d, start, chunksize, d->buffer);
|
||||||
|
if (flag & 2)
|
||||||
|
d->silent_on_scsi_error = sose_mem;
|
||||||
if (err == BE_CANCELLED) {
|
if (err == BE_CANCELLED) {
|
||||||
/* Try to read a smaller part of the chunk */
|
/* Try to read a smaller part of the chunk */
|
||||||
for (i = 0; i < chunksize - 1; i++) {
|
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);
|
err = d->read_10(d, start + i, 1, d->buffer);
|
||||||
|
if (flag & 2)
|
||||||
|
d->silent_on_scsi_error = sose_mem;
|
||||||
if (err == BE_CANCELLED)
|
if (err == BE_CANCELLED)
|
||||||
break;
|
break;
|
||||||
memcpy(wpt, d->buffer->data, 2048);
|
memcpy(wpt, d->buffer->data, 2048);
|
||||||
|
Loading…
Reference in New Issue
Block a user