]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
Linux: Test for __vfs_write rather than __vfs_read
authorDamien Diederen <ddiederen@sinenomine.net>
Mon, 18 Sep 2017 09:59:40 +0000 (11:59 +0200)
committerBenjamin Kaduk <kaduk@mit.edu>
Thu, 26 Oct 2017 01:17:25 +0000 (21:17 -0400)
The following commit:

    commit eb031849d52e61d24ba54e9d27553189ff328174
    Author: Christoph Hellwig <hch@lst.de>
    Date:   Fri Sep 1 17:39:23 2017 +0200

        fs: unexport __vfs_read/__vfs_write

unexports both __vfs_read and __vfs_write, but keeps the former in
fs.h--as it is is still being used by another part of the tree.

This situation results in a false positive in our Autoconf check,
which does not see the export statements, and ends up marking the
corresponding API as available.

That, in turn, causes some code which assumes symmetry with
__vfs_write to fail to compile.

Switch to testing for __vfs_write, which correctly marks the API as
unavailable.

Reviewed-on: https://gerrit.openafs.org/12728
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 929e77a886fc9853ee292ba1aa52a920c454e94b)

Change-Id: I03e3c8222360a6b04b45b45a8f56b5df054f6783
Reviewed-on: https://gerrit.openafs.org/12736
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
acinclude.m4
src/afs/LINUX/osi_compat.h
src/afs/LINUX/osi_vnodeops.c

index 0d28d441563c15f52f0ac0142bdb77315ce7f92a..162a3e9c3f464d3d932c2d0481e8947639a2ca8d 100644 (file)
@@ -1001,9 +1001,9 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*)
 
                 dnl Function existence checks
 
-                AC_CHECK_LINUX_FUNC([__vfs_read],
+                AC_CHECK_LINUX_FUNC([__vfs_write],
                                     [#include <linux/fs.h>],
-                                    [__vfs_read(NULL, NULL, 0, NULL);])
+                                    [__vfs_write(NULL, NULL, 0, NULL);])
                  AC_CHECK_LINUX_FUNC([bdi_init],
                                     [#include <linux/backing-dev.h>],
                                     [bdi_init(NULL);])
index 14762fab1caa6b97bae7b61c73810c5d4927272d..13915b9d1726c3a4e3841724f8481779c351b1b0 100644 (file)
@@ -648,7 +648,7 @@ afs_d_invalidate(struct dentry *dp)
 static inline int
 afs_file_read(struct file *filp, char __user *buf, size_t len, loff_t *pos)
 {
-#if defined(HAVE_LINUX___VFS_READ)
+#if defined(HAVE_LINUX___VFS_WRITE)
     return __vfs_read(filp, buf, len, pos);
 #else
     return filp->f_op->read(filp, buf, len, pos);
@@ -658,7 +658,7 @@ afs_file_read(struct file *filp, char __user *buf, size_t len, loff_t *pos)
 static inline int
 afs_file_write(struct file *filp, char __user *buf, size_t len, loff_t *pos)
 {
-#if defined(HAVE_LINUX___VFS_READ)
+#if defined(HAVE_LINUX___VFS_WRITE)
     return __vfs_write(filp, buf, len, pos);
 #else
     return filp->f_op->write(filp, buf, len, pos);
index d0585458da761f5f039c4526cc407e525f7b12be..d935cf56df4892187253a6f8af296962fef9f091 100644 (file)
@@ -825,7 +825,7 @@ struct file_operations afs_file_fops = {
 #ifdef STRUCT_FILE_OPERATIONS_HAS_READ_ITER
   .read_iter = afs_linux_read_iter,
   .write_iter =        afs_linux_write_iter,
-# if !defined(HAVE_LINUX___VFS_READ)
+# if !defined(HAVE_LINUX___VFS_WRITE)
   .read =      new_sync_read,
   .write =     new_sync_write,
 # endif