kernels/linux-2.6.24/mm/filemap.c
/*
 * CD/DVDs are error prone. When a medium error occurs, the driver may fail
 * a _large_ part of the i/o request. Imagine the worst scenario:
 *
 *      ---R__________________________________________B__________
 *         ^ reading here                             ^ bad block(assume 4k)
 *
 * read(R) => miss => readahead(R...B) => media error => frustrating retries
 * => failing the whole request => read(R) => read(R+1) =>
 * readahead(R+1...B+1) => bang => read(R+2) => read(R+3) =>
 * readahead(R+3...B+2) => bang => read(R+3) => read(R+4) =>
 * readahead(R+4...B+3) => bang => read(R+4) => read(R+5) => ......
 *
 * It is going insane. Fix it by quickly scaling down the readahead size.
 */
CD/DVDs are error prone. When a medium error occurs, the driver may fail
a _large_ part of the i/o request. Imagine the worst scenario.





It is going insane. Fix it by quickly scaling down the readahead size.
CD / DVDs are error prone . When a medium error occurs the driver may fail a _large_ part of the i / o request . Imagine the worst scenario . It is going insane . Fix it by quickly scaling down the readahead size .
static void shrink_readahead_size_eio(struct file *filp,
					struct file_ra_state *ra)
{
	if (!ra->ra_pages)
		return;
	ra->ra_pages /= 4;
}
static void shrink_readahead_size_eio ( struct file * filp , struct file_ra_state * ra ) { if ( ! ra -> ra_pages ) return ; ra -> ra_pages /= 4 ; }
CD/DVDs are error prone.
CD / DVDs are error prone .