[patch 1/2] fuse: generic_write_checks() for direct_io

From: Miklos Szeredi
Date: Fri May 18 2007 - 06:35:27 EST


Andrew,

These are for 2.6.22, please apply.

Thanks.

----
From: Miklos Szeredi <mszeredi@xxxxxxx>

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@xxxxxxx>
---

Index: linux/fs/fuse/file.c
===================================================================
--- linux.orig/fs/fuse/file.c 2007-04-26 12:54:32.000000000 +0200
+++ linux/fs/fuse/file.c 2007-05-02 20:17:27.000000000 +0200
@@ -609,7 +609,9 @@ static ssize_t fuse_direct_write(struct
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;
}
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/