public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [rfc patch 2/2] direct-io: remove address alignment check
@ 2005-07-13 23:43 Daniel McNeil
  2005-07-14 23:16 ` Badari Pulavarty
  2005-07-15  0:28 ` Tejun Heo
  0 siblings, 2 replies; 19+ messages in thread
From: Daniel McNeil @ 2005-07-13 23:43 UTC (permalink / raw)
  To: linux-aio@kvack.org, Linux Kernel Mailing List

This patch relaxes the direct i/o alignment check so that user addresses
do not have to be a multiple of the device block size.

I've done some preliminary testing and it mostly works on an ext3
file system on a ide disk.  I have seen trouble when the user address
is on an odd byte boundary.  Sometimes the data is read back incorrectly
on read and sometimes I get these kernel error messages:
	hda: dma_timer_expiry: dma status == 0x60
	hda: DMA timeout retry
	hda: timeout waiting for DMA
	hda: status error: status=0x58 { DriveReady SeekComplete DataRequest }
	ide: failed opcode was: unknown
	hda: drive not ready for command

Doing direct-io with user addresses on even, non-512 boundaries appears
to be working correctly.

Any additional testing and/or comments welcome.

Signed-off-by: Daniel McNeil <daniel@osdl.org>

--- linux-2.6.12.orig/fs/direct-io.c	2005-06-28 16:39:39.000000000 -0700
+++ linux-2.6.12/fs/direct-io.c	2005-06-28 16:39:59.000000000 -0700
@@ -1147,7 +1147,9 @@ __blockdev_direct_IO(int rw, struct kioc
 			goto out;
 	}
 
-	/* Check the memory alignment.  Blocks cannot straddle pages */
+	/*
+	 * Check the i/o.  It must be a multiple of device block size.
+	 */
 	for (seg = 0; seg < nr_segs; seg++) {
 		addr = (unsigned long)iov[seg].iov_base;
 		size = iov[seg].iov_len;
@@ -1156,7 +1158,7 @@ __blockdev_direct_IO(int rw, struct kioc
 			if (bdev)
 				 blkbits = bdev_blkbits;
 			blocksize_mask = (1 << blkbits) - 1;
-			if ((addr & blocksize_mask) || (size & blocksize_mask))
+			if (size & blocksize_mask)
 				goto out;
 		}
 	}



^ permalink raw reply	[flat|nested] 19+ messages in thread
[parent not found: <1121298112.6025.21.camel@ibm-c.pdx.osdl.net.suse.lists.linux.kernel>]

end of thread, other threads:[~2005-07-16  3:51 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-07-13 23:43 [rfc patch 2/2] direct-io: remove address alignment check Daniel McNeil
2005-07-14 23:16 ` Badari Pulavarty
2005-07-14 23:44   ` Daniel McNeil
2005-07-15  5:27     ` Badari Pulavarty
2005-07-15 20:06       ` Daniel McNeil
2005-07-15  0:28 ` Tejun Heo
2005-07-15  5:18   ` Badari Pulavarty
2005-07-15  8:23     ` Tejun Heo
2005-07-15 17:54       ` Badari Pulavarty
2005-07-16  3:50         ` Tejun Heo
2005-07-15 16:56     ` Joel Becker
2005-07-15 17:50       ` Badari Pulavarty
2005-07-15 19:16         ` Joel Becker
     [not found] <1121298112.6025.21.camel@ibm-c.pdx.osdl.net.suse.lists.linux.kernel>
2005-07-14 13:18 ` Andi Kleen
2005-07-14 16:02   ` Daniel McNeil
2005-07-14 18:23     ` Andi Kleen
2005-07-14 20:40       ` Daniel McNeil
2005-07-14 23:39         ` Andrew Morton
2005-07-15  0:03           ` Daniel McNeil

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox