diff options
author | Miklos Szeredi <mszeredi@suse.cz> | 2007-05-23 13:57:54 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-05-23 20:14:13 -0700 |
commit | 889f784831d6cc9125a74eb55a5641f95635a204 (patch) | |
tree | 6336e0a52fa2e87b15df5dcb7cafe07e300bd2f4 /fs/fuse | |
parent | 492c8b332e3af279ffadf49b85967d5e43810923 (diff) | |
download | linux-3.10-889f784831d6cc9125a74eb55a5641f95635a204.tar.gz linux-3.10-889f784831d6cc9125a74eb55a5641f95635a204.tar.bz2 linux-3.10-889f784831d6cc9125a74eb55a5641f95635a204.zip |
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: Miklos Szeredi <mszeredi@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/fuse')
-rw-r--r-- | fs/fuse/file.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/fuse/file.c b/fs/fuse/file.c index d0ed60bc318..adf7995232b 100644 --- a/fs/fuse/file.c +++ b/fs/fuse/file.c @@ -610,7 +610,9 @@ static ssize_t fuse_direct_write(struct file *file, const char __user *buf, ssize_t res; /* Don't allow parallel writes to the same file */ mutex_lock(&inode->i_mutex); - res = fuse_direct_io(file, buf, count, ppos, 1); + res = generic_write_checks(file, ppos, &count, 0); + if (!res) + res = fuse_direct_io(file, buf, count, ppos, 1); mutex_unlock(&inode->i_mutex); return res; } |