From 4753bae7f3939ff08e70cf9efc1a26b4bf2d29fe Mon Sep 17 00:00:00 2001 From: "John L. Hammond" Date: Thu, 8 Mar 2018 13:23:34 -0600 Subject: [PATCH] LU-10788 llite: pass flags through __vfs_setxattr() In the compat definition of __vfs_setxattr() pass the flags we received down to the handler. For consistency with upstream return -EOPNOTSUPP if no handler could be found. Signed-off-by: John L. Hammond Change-Id: I78b88d1521dd000e328f1add1a6159c70d16f5a7 Reviewed-on: https://review.whamcloud.com/31593 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: James Simmons Reviewed-by: Andreas Dilger Reviewed-by: Dmitry Eremin --- lustre/include/lustre_compat.h | 31 ++++++++++++------------------- 1 file changed, 12 insertions(+), 19 deletions(-) diff --git a/lustre/include/lustre_compat.h b/lustre/include/lustre_compat.h index 37cca5a..937935d 100644 --- a/lustre/include/lustre_compat.h +++ b/lustre/include/lustre_compat.h @@ -468,37 +468,30 @@ int ll_removexattr(struct dentry *dentry, const char *name); #ifndef HAVE_VFS_SETXATTR const struct xattr_handler *get_xattr_type(const char *name); -#ifdef HAVE_XATTR_HANDLER_FLAGS static inline int __vfs_setxattr(struct dentry *dentry, struct inode *inode, const char *name, const void *value, size_t size, int flags) { +# ifdef HAVE_XATTR_HANDLER_FLAGS const struct xattr_handler *handler; int rc; handler = get_xattr_type(name); if (!handler) - return -ENXIO; - -#if defined(HAVE_XATTR_HANDLER_INODE_PARAM) - rc = handler->set(handler, dentry, inode, name, value, size, - XATTR_CREATE); -#elif defined(HAVE_XATTR_HANDLER_SIMPLIFIED) - rc = handler->set(handler, dentry, name, value, size, XATTR_CREATE); -#else - rc = handler->set(dentry, name, value, size, XATTR_CREATE, - handler->flags); -#endif /* !HAVE_XATTR_HANDLER_INODE_PARAM */ + return -EOPNOTSUPP; + +# if defined(HAVE_XATTR_HANDLER_INODE_PARAM) + rc = handler->set(handler, dentry, inode, name, value, size, flags); +# elif defined(HAVE_XATTR_HANDLER_SIMPLIFIED) + rc = handler->set(handler, dentry, name, value, size, flags); +# else + rc = handler->set(dentry, name, value, size, flags, handler->flags); +# endif /* !HAVE_XATTR_HANDLER_INODE_PARAM */ return rc; -} -#else /* !HAVE_XATTR_HANDLER_FLAGS */ -static inline int -__vfs_setxattr(struct dentry *dentry, struct inode *inode, const char *name, - const void *value, size_t size, int flags) -{ +# else /* !HAVE_XATTR_HANDLER_FLAGS */ return ll_setxattr(dentry, name, value, size, flags); +# endif /* HAVE_XATTR_HANDLER_FLAGS */ } -#endif /* HAVE_XATTR_HANDLER_FLAGS */ #endif /* HAVE_VFS_SETXATTR */ #ifdef HAVE_IOP_SET_ACL -- 1.8.3.1