aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiklos Szeredi <miklos@szeredi.hu>2007-03-14 09:13:27 +0000
committerMiklos Szeredi <miklos@szeredi.hu>2007-03-14 09:13:27 +0000
commit2f759e1950e3908eb48fc000e88e0159649d8632 (patch)
tree32caeb503d8eca18617a1d3c092cb08ffb48ecac
parent3a7c00ec0c156123c47b53ec1cd7ead001fa4dfb (diff)
downloadlibfuse-2f759e1950e3908eb48fc000e88e0159649d8632.tar.gz
Correctly handle O_APPEND in direct IO mode
-rw-r--r--ChangeLog5
-rw-r--r--configure.in2
-rw-r--r--kernel/file.c4
-rw-r--r--lib/fuse.c1
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++;