Commit 889f7848 authored by Miklos Szeredi's avatar Miklos Szeredi Committed by Linus Torvalds

fuse: generic_write_checks() for direct_io

This fixes O_APPEND in direct IO mode.  Also checks writes against file size
limits, notably rlimits.

Reported by Greg Bruno.
Signed-off-by: default avatarMiklos Szeredi <mszeredi@suse.cz>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 492c8b33
...@@ -610,6 +610,8 @@ static ssize_t fuse_direct_write(struct file *file, const char __user *buf, ...@@ -610,6 +610,8 @@ static ssize_t fuse_direct_write(struct file *file, const char __user *buf,
ssize_t res; ssize_t res;
/* Don't allow parallel writes to the same file */ /* Don't allow parallel writes to the same file */
mutex_lock(&inode->i_mutex); mutex_lock(&inode->i_mutex);
res = generic_write_checks(file, ppos, &count, 0);
if (!res)
res = fuse_direct_io(file, buf, count, ppos, 1); res = fuse_direct_io(file, buf, count, ppos, 1);
mutex_unlock(&inode->i_mutex); mutex_unlock(&inode->i_mutex);
return res; return res;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment