From: Jeff Moyer <jmoyer@redhat.com>
To: linux-ext4@vger.kernel.org
Subject: [patch] ext4: clean up the flags passed to __blockdev_direct_IO for extent-based files
Date: Fri, 24 Feb 2012 16:49:21 -0500 [thread overview]
Message-ID: <x49zkc7c36m.fsf@segfault.boston.devel.redhat.com> (raw)
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;
/*
next reply other threads:[~2012-02-24 21:49 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-24 21:49 Jeff Moyer [this message]
2012-02-24 21:52 ` [patch] ext4: clean up the flags passed to __blockdev_direct_IO for extent-based files Eric Sandeen
2012-03-05 15:25 ` Ted Ts'o
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=x49zkc7c36m.fsf@segfault.boston.devel.redhat.com \
--to=jmoyer@redhat.com \
--cc=linux-ext4@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).