]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
linux: fsync on a directory should return 0, not EINVAL
authorGeoffrey Thomas <geofft@ldpreload.com>
Sun, 1 Jan 2012 00:51:29 +0000 (19:51 -0500)
committerDerrick Brashear <shadow@dementix.org>
Tue, 3 Jan 2012 18:38:22 +0000 (10:38 -0800)
Directory writes are synchronous, so this is fine. There's a
mostly-convenient function in fs/libfs.c that returns 0 that we can use
to do what we want ("mostly" because it was renamed in 2.6.35).

FIXES 130425

Reviewed-on: http://gerrit.openafs.org/6491
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit 267934d0e6910c8d8166a6e78f93c1bab40857b8)

Change-Id: Iaeb8a699673b6144c186b470f6d877fb54f1e319
Reviewed-on: http://gerrit.openafs.org/6493
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
acinclude.m4
src/afs/LINUX/osi_vnodeops.c

index 80f20ac369570eb45bb32aa550f19b19ce49aa5f..c7bb588704d0ae0636bdab73636e0bbb0538bf8e 100644 (file)
@@ -896,6 +896,9 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*)
                 AC_CHECK_LINUX_FUNC([zero_user_segments],
                                     [#include <linux/highmem.h>],
                                     [zero_user_segments(NULL, 0, 0, 0, 0);])
+                AC_CHECK_LINUX_FUNC([noop_fsync],
+                                    [#include <linux/fs.h>],
+                                    [noop_fsync(NULL, 0, 0, 0);])
 
                 dnl Consequences - things which get set as a result of the
                 dnl                above tests
index 2cbf2b14bd7e2869c4774e9efb4b0a366dc92339..2d9eb8e1175318d30d37848e44ccea235b422558 100644 (file)
@@ -655,6 +655,11 @@ struct file_operations afs_dir_fops = {
   .open =      afs_linux_open,
   .release =   afs_linux_release,
   .llseek =    default_llseek,
+#ifdef HAVE_LINUX_NOOP_FSYNC
+  .fsync =     noop_fsync,
+#else
+  .fsync =     simple_sync_file,
+#endif
 };
 
 struct file_operations afs_file_fops = {