Skip to content

Commit

Permalink
Linux 4.2 compat: vfs_rename()
Browse files Browse the repository at this point in the history
Attempting to perform a vfs_rename() on Linux 4.2 and newer kernels
results in an EACCES error.  Rather than attempting to add and
maintain more ugly compatibility code it's best to just retire
this interface.  As a first step the SPLAT test is disabled for
Linux 4.2 and newer kernels.

  vn_rename: Failed vn_rename /tmp/vn.tmp.1 -> /tmp/vn.tmp.2 (13)

Signed-off-by: Brian Behlendorf <[email protected]>
Issue openzfs#3653
  • Loading branch information
behlendorf committed Aug 19, 2015
1 parent 851a549 commit ebc2c93
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions module/splat/splat-internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include "splat-ctl.h"
#include <sys/mutex.h>
#include <linux/file_compat.h>
#include <linux/version.h>

#define SPLAT_SUBSYSTEM_INIT(type) \
({ splat_subsystem_t *_sub_; \
Expand Down
6 changes: 6 additions & 0 deletions module/splat/splat-vnode.c
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ splat_vnode_test3(struct file *file, void *arg)
return -rc;
} /* splat_vnode_test3() */

#if LINUX_VERSION_CODE <= KERNEL_VERSION(4,1,0)
static int
splat_vnode_test4(struct file *file, void *arg)
{
Expand Down Expand Up @@ -303,6 +304,7 @@ splat_vnode_test4(struct file *file, void *arg)

return -rc;
} /* splat_vnode_test4() */
#endif

static int
splat_vnode_test5(struct file *file, void *arg)
Expand Down Expand Up @@ -413,8 +415,10 @@ splat_vnode_init(void)
SPLAT_VNODE_TEST2_ID, splat_vnode_test2);
SPLAT_TEST_INIT(sub, SPLAT_VNODE_TEST3_NAME, SPLAT_VNODE_TEST3_DESC,
SPLAT_VNODE_TEST3_ID, splat_vnode_test3);
#if LINUX_VERSION_CODE <= KERNEL_VERSION(4,1,0)
SPLAT_TEST_INIT(sub, SPLAT_VNODE_TEST4_NAME, SPLAT_VNODE_TEST4_DESC,
SPLAT_VNODE_TEST4_ID, splat_vnode_test4);
#endif
SPLAT_TEST_INIT(sub, SPLAT_VNODE_TEST5_NAME, SPLAT_VNODE_TEST5_DESC,
SPLAT_VNODE_TEST5_ID, splat_vnode_test5);
SPLAT_TEST_INIT(sub, SPLAT_VNODE_TEST6_NAME, SPLAT_VNODE_TEST6_DESC,
Expand All @@ -430,7 +434,9 @@ splat_vnode_fini(splat_subsystem_t *sub)

SPLAT_TEST_FINI(sub, SPLAT_VNODE_TEST6_ID);
SPLAT_TEST_FINI(sub, SPLAT_VNODE_TEST5_ID);
#if LINUX_VERSION_CODE <= KERNEL_VERSION(4,1,0)
SPLAT_TEST_FINI(sub, SPLAT_VNODE_TEST4_ID);
#endif
SPLAT_TEST_FINI(sub, SPLAT_VNODE_TEST3_ID);
SPLAT_TEST_FINI(sub, SPLAT_VNODE_TEST2_ID);
SPLAT_TEST_FINI(sub, SPLAT_VNODE_TEST1_ID);
Expand Down

0 comments on commit ebc2c93

Please sign in to comment.