diff --git a/fs/hmdfs/hmdfs_device_view.h b/fs/hmdfs/hmdfs_device_view.h index f83c35df886ea67c6d641057cdbf90b6dcbf1174..57403e5470ffda0025c1ed8d459b8c369c112276 100644 --- a/fs/hmdfs/hmdfs_device_view.h +++ b/fs/hmdfs/hmdfs_device_view.h @@ -249,9 +249,6 @@ static inline bool hmdfs_support_xattr(struct dentry *dentry) info->inode_type != HMDFS_LAYER_OTHER_MERGE_CLOUD) return false; - if (!S_ISREG(inode->i_mode)) - return false; - if (info->inode_type == HMDFS_LAYER_OTHER_LOCAL && hm_islnk(hmdfs_d(dentry)->file_type)) return false; diff --git a/fs/hmdfs/main.c b/fs/hmdfs/main.c index 9492d067bb19a81592c04d074530a64b9d0d855d..a8d93feacbe7bc085adbcda59c75b724a655e1f3 100644 --- a/fs/hmdfs/main.c +++ b/fs/hmdfs/main.c @@ -153,12 +153,14 @@ static int hmdfs_xattr_local_set(struct dentry *dentry, const char *name, int res = 0; hmdfs_get_lower_path(dentry, &lower_path); + kuid_t tmp_uid = hmdfs_override_inode_uid(d_inode(lower_path.dentry)); if (value) { res = vfs_setxattr(lower_path.dentry, name, value, size, flags); } else { WARN_ON(flags != XATTR_REPLACE); res = vfs_removexattr(lower_path.dentry, name); } + hmdfs_revert_inode_uid(d_inode(lower_path.dentry), tmp_uid); hmdfs_put_lower_path(&lower_path); return res; @@ -208,9 +210,6 @@ static int hmdfs_xattr_set(const struct xattr_handler *handler, if (!hmdfs_support_xattr(dentry)) return -EOPNOTSUPP; - if (strncmp(name, XATTR_USER_PREFIX, XATTR_USER_PREFIX_LEN)) - return -EOPNOTSUPP; - if (size > HMDFS_XATTR_SIZE_MAX) { hmdfs_info("no support too long xattr value: %zu", size); return -E2BIG;