All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch] ext4: clean up the flags passed to __blockdev_direct_IO for extent-based files
@ 2012-02-24 21:49 Jeff Moyer
  2012-02-24 21:52 ` Eric Sandeen
  2012-03-05 15:25 ` Ted Ts'o
  0 siblings, 2 replies; 3+ messages in thread
From: Jeff Moyer @ 2012-02-24 21:49 UTC (permalink / raw)
  To: linux-ext4

Hi,

For extent-based files, you can perform DIO to holes, as mentioned in
the comments in ext4_ext_direct_IO.  However, that function passes
DIO_SKIP_HOLES to __blockdev_direct_IO, which is *really* confusing to
the uninitiated reader.  The key, here, is that the get_block function
passed in, ext4_get_block_write, completely ignores the create flag that
is passed to it (the create flag is passed in from the direct I/O code,
which uses the DIO_SKIP_HOLES flag to determine whether or not it should
be cleared).

This is a long-winded way of saying that the DIO_SKIP_HOLES flag is
ultimately ignored.  So, in the interest of preserving sanity, I propose
the following patch.

Cheers,
Jeff

Signed-off-by: Jeff Moyer <jmoyer@redhat.com>

diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index feaa82f..521ca03 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -2940,7 +2940,7 @@ static ssize_t ext4_ext_direct_IO(int rw, struct kiocb *iocb,
 					 ext4_get_block_write,
 					 ext4_end_io_dio,
 					 NULL,
-					 DIO_LOCKING | DIO_SKIP_HOLES);
+					 DIO_LOCKING);
 		if (iocb->private)
 			EXT4_I(inode)->cur_aio_dio = NULL;
 		/*

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-03-05 15:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-24 21:49 [patch] ext4: clean up the flags passed to __blockdev_direct_IO for extent-based files Jeff Moyer
2012-02-24 21:52 ` Eric Sandeen
2012-03-05 15:25 ` Ted Ts'o

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.