summaryrefslogtreecommitdiffstats
path: root/fs/ext4
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2016-09-30 01:55:32 -0400
committerTheodore Ts'o <tytso@mit.edu>2016-09-30 01:55:32 -0400
commit4b0524aae0082272737c97d2b160d55d6e8f0b2b (patch)
treebcf0c22447beb12238736a2b61066978a81f8004 /fs/ext4
parent9a200d075e5d05be1fcad4547a0f8aee4e2f9a04 (diff)
downloadlinux-4b0524aae0082272737c97d2b160d55d6e8f0b2b.tar.bz2
ext4: allow unlocked direct IO when pages are cached
Currently we do not allow unlocked (meaning without inode_lock) direct IO when the file has any pages cached. This check is not needed anymore as we keep inode lock until ext4_direct_IO_write() and thus can happily writeback and evict any pages conflicting with current direct IO write. Signed-off-by: Jan Kara <jack@suse.cz> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'fs/ext4')
-rw-r--r--fs/ext4/file.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/ext4/file.c b/fs/ext4/file.c
index 34acda78ce25..25342c8dd5d6 100644
--- a/fs/ext4/file.c
+++ b/fs/ext4/file.c
@@ -91,7 +91,6 @@ ext4_unaligned_aio(struct inode *inode, struct iov_iter *from, loff_t pos)
static ssize_t
ext4_file_write_iter(struct kiocb *iocb, struct iov_iter *from)
{
- struct file *file = iocb->ki_filp;
struct inode *inode = file_inode(iocb->ki_filp);
struct blk_plug plug;
int o_direct = iocb->ki_flags & IOCB_DIRECT;
@@ -138,7 +137,7 @@ ext4_file_write_iter(struct kiocb *iocb, struct iov_iter *from)
/* check whether we do a DIO overwrite or not */
if (ext4_should_dioread_nolock(inode) && !unaligned_aio &&
- !file->f_mapping->nrpages && pos + length <= i_size_read(inode)) {
+ pos + length <= i_size_read(inode)) {
struct ext4_map_blocks map;
unsigned int blkbits = inode->i_blkbits;
int err, len;