From 2f759e1950e3908eb48fc000e88e0159649d8632 Mon Sep 17 00:00:00 2001 From: Miklos Szeredi <miklos@szeredi.hu> Date: Wed, 14 Mar 2007 09:13:27 +0000 Subject: [PATCH] Correctly handle O_APPEND in direct IO mode --- ChangeLog | 5 +++++ configure.in | 2 -- kernel/file.c | 4 +++- lib/fuse.c | 1 + 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 80398c5..0a28731 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2007-03-05 Miklos Szeredi <miklos@szeredi.hu> + + * Correctly handle O_APPEND in direct IO mode. Reported by Greg + Bruno + 2007-02-03 Miklos Szeredi <miklos@szeredi.hu> * Add filesystem stacking support to high level API. Filesystem diff --git a/configure.in b/configure.in index 3020f39..b2ef187 100644 --- a/configure.in +++ b/configure.in @@ -88,7 +88,5 @@ AC_SUBST(subdirs2) AM_CONDITIONAL(LINUX, test "$arch" = linux) AM_CONDITIONAL(BSD, test "$arch" = bsd) -AC_CHECK_HEADERS(selinux/selinux.h, AC_CHECK_LIB(selinux, getfilecon)) - AC_CONFIG_FILES([fuse.pc Makefile lib/Makefile util/Makefile example/Makefile include/Makefile]) AC_OUTPUT diff --git a/kernel/file.c b/kernel/file.c index d0f46ad..bdec3a5 100644 --- a/kernel/file.c +++ b/kernel/file.c @@ -627,7 +627,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; } diff --git a/lib/fuse.c b/lib/fuse.c index bc944c7..78a2547 100644 --- a/lib/fuse.c +++ b/lib/fuse.c @@ -3266,6 +3266,7 @@ static struct fuse *fuse_new_common_compat25(int fd, struct fuse_args *args, main() has been called) */ void fuse_register_module(struct fuse_module *mod) { + mod->ctr = 0; mod->so = fuse_current_so; if (mod->so) mod->so->ctr++; -- 2.30.2