[PATCH v3 05/12] fs: remove unneeded IS_DAX() check

From: ira . weiny
Date: Sat Feb 08 2020 - 14:35:22 EST


From: Ira Weiny <ira.weiny@xxxxxxxxx>

The IS_DAX() check in io_is_direct() causes a race between changing the
DAX state and creating the iocb flags.

Remove the check because DAX now emulates the page cache API and
therefore it does not matter if the file state is DAX or not when the
iocb flags are created.

Reviewed-by: Jan Kara <jack@xxxxxxx>
Signed-off-by: Ira Weiny <ira.weiny@xxxxxxxxx>
---
include/linux/fs.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/fs.h b/include/linux/fs.h
index 3cd4fe6b845e..63d1e533a07d 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -3388,7 +3388,7 @@ extern int file_update_time(struct file *file);

static inline bool io_is_direct(struct file *filp)
{
- return (filp->f_flags & O_DIRECT) || IS_DAX(filp->f_mapping->host);
+ return (filp->f_flags & O_DIRECT);
}

static inline bool vma_is_dax(struct vm_area_struct *vma)
--
2.21.0