diff options
Diffstat (limited to 'fs/open.c')
-rw-r--r-- | fs/open.c | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -818,6 +818,14 @@ static int do_dentry_open(struct file *f, | |||
818 | if (!f->f_mapping->a_ops || !f->f_mapping->a_ops->direct_IO) | 818 | if (!f->f_mapping->a_ops || !f->f_mapping->a_ops->direct_IO) |
819 | return -EINVAL; | 819 | return -EINVAL; |
820 | } | 820 | } |
821 | |||
822 | /* | ||
823 | * XXX: Huge page cache doesn't support writing yet. Drop all page | ||
824 | * cache for this file before processing writes. | ||
825 | */ | ||
826 | if ((f->f_mode & FMODE_WRITE) && filemap_nr_thps(inode->i_mapping)) | ||
827 | truncate_pagecache(inode, 0); | ||
828 | |||
821 | return 0; | 829 | return 0; |
822 | 830 | ||
823 | cleanup_all: | 831 | cleanup_all: |