From: Sebastien Buisson Date: Tue, 21 Apr 2020 07:28:20 +0000 (+0200) Subject: LU-13465 vfs: make ll_vfs_setxattr return -EOPNOTSUPP X-Git-Tag: 2.13.54~127 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=b4d061dfa6d8a80020925c20e81b26a766509bf5;p=fs%2Flustre-release.git LU-13465 vfs: make ll_vfs_setxattr return -EOPNOTSUPP New compat macros ll_vfs_setxattr/ll_vfs_removexattr need to return -EOPNOTSUPP instead of -ENOTSUPP. Indeed, the llapi_layout_get_by_fd() code checks for "-EOPNOTSUPP" and handles this specially. Also, the case of missing i_op->setxattr() and i_op->getxattr() can be considered unlikely. Test-Parameters: clientversion=2.12 envdefinitions=SANITY_EXCEPT="27M 56ra 151 156 802" Signed-off-by: Sebastien Buisson Change-Id: I2474c184a1597979971881de84638fb8d281f704 Reviewed-on: https://review.whamcloud.com/38301 Reviewed-by: Andreas Dilger Tested-by: jenkins Tested-by: Maloo Reviewed-by: James Simmons Reviewed-by: Oleg Drokin --- diff --git a/lustre/include/lustre_compat.h b/lustre/include/lustre_compat.h index b9e5ca8..3db844c 100644 --- a/lustre/include/lustre_compat.h +++ b/lustre/include/lustre_compat.h @@ -521,7 +521,7 @@ static inline int ll_vfs_getxattr(struct dentry *dentry, struct inode *inode, void *value, size_t size) { #ifndef HAVE_VFS_SETXATTR - if (!inode->i_op->getxattr) + if (unlikely(!inode->i_op->getxattr)) return -ENODATA; return inode->i_op->getxattr(dentry, name, value, size); @@ -535,8 +535,8 @@ static inline int ll_vfs_setxattr(struct dentry *dentry, struct inode *inode, const void *value, size_t size, int flags) { #ifndef HAVE_VFS_SETXATTR - if (!inode->i_op->setxattr) - return -ENOTSUPP; + if (unlikely(!inode->i_op->setxattr)) + return -EOPNOTSUPP; return inode->i_op->setxattr(dentry, name, value, size, flags); #else @@ -548,8 +548,8 @@ static inline int ll_vfs_removexattr(struct dentry *dentry, struct inode *inode, const char *name) { #ifndef HAVE_VFS_SETXATTR - if (!inode->i_op->setxattr) - return -ENOTSUPP; + if (unlikely(!inode->i_op->setxattr)) + return -EOPNOTSUPP; return inode->i_op->removexattr(dentry, name); #else