Re: [PATCH 1/2] jfs: Clean up xattr name mapping
Dave Kleikamp <[email protected]>
| Newsgroups | gmane.comp.file-systems.jfs.general |
|---|---|
| Message-ID | <66afb02d-5dba-025a-a5a5-a4cc7510b153__43584.975138265$1461767424$gmane$org@oracle.com> |
On 04/22/2016 07:43 AM, Andreas Gruenbacher wrote:
> Instead of stripping "os2." prefixes in __jfs_setxattr, make callers
> strip them, as __jfs_getxattr already does. With that change, use the
> same name mapping function in jfs_{get,set,remove}xattr.
>
> Signed-off-by: Andreas Gruenbacher <[email protected]>
> ---
> fs/jfs/xattr.c | 80 ++++++++++++++++++----------------------------------------
> 1 file changed, 25 insertions(+), 55 deletions(-)
>
> diff --git a/fs/jfs/xattr.c b/fs/jfs/xattr.c
> index 5becc6a..9cdf7dc 100644
> --- a/fs/jfs/xattr.c
> +++ b/fs/jfs/xattr.c
--- cut ---
> @@ -946,18 +926,8 @@ ssize_t jfs_getxattr(struct dentry *dentry, struct inode *inode,
> if (!strncmp(name, XATTR_SYSTEM_PREFIX, XATTR_SYSTEM_PREFIX_LEN))
> return generic_getxattr(dentry, inode, name, data, buf_size);
Am I missing a prerequisite patch? This patch doesn't apply because
generic_getxattr() doesn't have an inode parameter.
>
> - if (strncmp(name, XATTR_OS2_PREFIX, XATTR_OS2_PREFIX_LEN) == 0) {
> - /*
> - * skip past "os2." prefix
> - */
> - name += XATTR_OS2_PREFIX_LEN;
> - /*
> - * Don't allow retrieving properly prefixed attributes
> - * by prepending them with "os2."
> - */
> - if (is_known_namespace(name))
> - return -EOPNOTSUPP;
> - }
> + if (!map_name_to_disk(&name))
> + return -EOPNOTSUPP;
>
> err = __jfs_getxattr(inode, name, data, buf_size);
>
> @@ -1042,8 +1012,8 @@ int jfs_removexattr(struct dentry *dentry, const char *name)
> if (!strncmp(name, XATTR_SYSTEM_PREFIX, XATTR_SYSTEM_PREFIX_LEN))
> return generic_removexattr(dentry, name);
>
> - if ((rc = can_set_xattr(inode, name, NULL, 0)))
> - return rc;
> + if (!map_name_to_disk(&name))
> + return -EOPNOTSUPP;
>
> tid = txBegin(inode->i_sb, 0);
> mutex_lock(&ji->commit_mutex);
>
------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z