projects
/
linux-2.6-block.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge tag 'pwm/for-5.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/thierry...
[linux-2.6-block.git]
/
fs
/
open.c
diff --git
a/fs/open.c
b/fs/open.c
index a59abe3c669ae13ac7f3fa68bc0fb5f54a781ee4..b62f5c0923a80cc168904b940e564fb2721a4f40 100644
(file)
--- a/
fs/open.c
+++ b/
fs/open.c
@@
-776,7
+776,7
@@
static int do_dentry_open(struct file *f,
f->f_mode |= FMODE_ATOMIC_POS;
f->f_op = fops_get(inode->i_fop);
f->f_mode |= FMODE_ATOMIC_POS;
f->f_op = fops_get(inode->i_fop);
- if (
unlikely(WARN_ON(!f->f_op)
)) {
+ if (
WARN_ON(!f->f_op
)) {
error = -ENODEV;
goto cleanup_all;
}
error = -ENODEV;
goto cleanup_all;
}
@@
-818,6
+818,14
@@
static int do_dentry_open(struct file *f,
if (!f->f_mapping->a_ops || !f->f_mapping->a_ops->direct_IO)
return -EINVAL;
}
if (!f->f_mapping->a_ops || !f->f_mapping->a_ops->direct_IO)
return -EINVAL;
}
+
+ /*
+ * XXX: Huge page cache doesn't support writing yet. Drop all page
+ * cache for this file before processing writes.
+ */
+ if ((f->f_mode & FMODE_WRITE) && filemap_nr_thps(inode->i_mapping))
+ truncate_pagecache(inode, 0);
+
return 0;
cleanup_all:
return 0;
cleanup_all: