From: Miklos Szeredi Date: Wed, 23 May 2007 20:57:54 +0000 (-0700) Subject: fuse: generic_write_checks() for direct_io X-Git-Tag: v2.6.22-rc3~52 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=889f784831d6cc9125a74eb55a5641f95635a204;p=linux-2.6 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 Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/fs/fuse/file.c b/fs/fuse/file.c index d0ed60bc31..adf7995232 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; }