From: Geoffrey Thomas Date: Sun, 1 Jan 2012 00:51:29 +0000 (-0500) Subject: linux: fsync on a directory should return 0, not EINVAL X-Git-Tag: upstream/1.6.1.pre2^2~19 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=babc991c0196a1c04e94fca934d2de63f37c6144;p=packages%2Fo%2Fopenafs.git linux: fsync on a directory should return 0, not EINVAL 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 Tested-by: BuildBot Reviewed-by: Derrick Brashear (cherry picked from commit 267934d0e6910c8d8166a6e78f93c1bab40857b8) Change-Id: Iaeb8a699673b6144c186b470f6d877fb54f1e319 Reviewed-on: http://gerrit.openafs.org/6493 Tested-by: BuildBot Reviewed-by: Derrick Brashear --- diff --git a/acinclude.m4 b/acinclude.m4 index 80f20ac36..c7bb58870 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -896,6 +896,9 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*) AC_CHECK_LINUX_FUNC([zero_user_segments], [#include ], [zero_user_segments(NULL, 0, 0, 0, 0);]) + AC_CHECK_LINUX_FUNC([noop_fsync], + [#include ], + [noop_fsync(NULL, 0, 0, 0);]) dnl Consequences - things which get set as a result of the dnl above tests diff --git a/src/afs/LINUX/osi_vnodeops.c b/src/afs/LINUX/osi_vnodeops.c index 2cbf2b14b..2d9eb8e11 100644 --- a/src/afs/LINUX/osi_vnodeops.c +++ b/src/afs/LINUX/osi_vnodeops.c @@ -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 = {