diff options
Diffstat (limited to 'fs/fuse/file.c')
-rw-r--r-- | fs/fuse/file.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/fuse/file.c b/fs/fuse/file.c index acfad65a6e8e..adf7995232b8 100644 --- a/fs/fuse/file.c +++ b/fs/fuse/file.c | |||
@@ -11,6 +11,7 @@ | |||
11 | #include <linux/pagemap.h> | 11 | #include <linux/pagemap.h> |
12 | #include <linux/slab.h> | 12 | #include <linux/slab.h> |
13 | #include <linux/kernel.h> | 13 | #include <linux/kernel.h> |
14 | #include <linux/sched.h> | ||
14 | 15 | ||
15 | static const struct file_operations fuse_direct_io_file_operations; | 16 | static const struct file_operations fuse_direct_io_file_operations; |
16 | 17 | ||
@@ -609,7 +610,9 @@ static ssize_t fuse_direct_write(struct file *file, const char __user *buf, | |||
609 | ssize_t res; | 610 | ssize_t res; |
610 | /* Don't allow parallel writes to the same file */ | 611 | /* Don't allow parallel writes to the same file */ |
611 | mutex_lock(&inode->i_mutex); | 612 | mutex_lock(&inode->i_mutex); |
612 | res = fuse_direct_io(file, buf, count, ppos, 1); | 613 | res = generic_write_checks(file, ppos, &count, 0); |
614 | if (!res) | ||
615 | res = fuse_direct_io(file, buf, count, ppos, 1); | ||
613 | mutex_unlock(&inode->i_mutex); | 616 | mutex_unlock(&inode->i_mutex); |
614 | return res; | 617 | return res; |
615 | } | 618 | } |