lkml.org 
[lkml]   [1997]   [Jan]   [12]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
DateSun, 12 Jan 1997 19:26:16 +0100 (MET)
FromIngo Molnar <>
SubjectRe: reading /dev/scd0 blocks sync(2) why ?
On Sun, 12 Jan 1997, Harald Koenig wrote:

> when I'm reading data from a SCSI CDROM e.g. using 
> 
> 	dd if=/dev/scd0 bs=2k of=/dev/null
> 
> the sync(2) system call is blocked until the "dd" command is terminated.
> why ?  dd opens /dev/scd0 read-only; writing to a pipe gives the same
> problem so it's not writing to /dev/null...

'sync' waits for all IO to complete. While the first block has finished, a
new one is started. Does this patch help? It should skip all buffers that
are not dirty (ie. a read is being done most probably). It's against
2.1.20, compiles fine but is untested otherwise.

--- source/linux-2.1.20_orig/fs/buffer.c	Wed Jan  1 15:56:21 1997
+++ linux/fs/buffer.c	Sun Jan 12 19:22:01 1997
@@ -216,6 +216,8 @@
 					retry = 1;
 					continue;
 				}
+				if (!buffer_dirty(bh))
+					continue;
 				wait_on_buffer (bh);
 				goto repeat2;
 			}


\
 
 \ /
  Last update: 2005-03-22 12:38    [W:0.083 / U:0.140 seconds]
©2003-2008 Jasper Spaans