[Cluster-devel] [PATCH 3/8] cifs: Fix removexattr for os2.* xattrs
Steve French
smfrench at gmail.com
Thu Apr 14 04:27:47 UTC 2016
merged into cifs-2.6.git
checkpatch complained about comment formatting so I cleaned that up in
attached trivial followon patch.
On Wed, Apr 13, 2016 at 5:30 PM, Andreas Gruenbacher
<agruenba at redhat.com> wrote:
> If cifs_removexattr finds a "user." or "os2." xattr name prefix, it
> skips 5 bytes, one byte too many for "os2.".
>
> Signed-off-by: Andreas Gruenbacher <agruenba at redhat.com>
> ---
> fs/cifs/xattr.c | 26 +++++++++++++++++---------
> 1 file changed, 17 insertions(+), 9 deletions(-)
>
> diff --git a/fs/cifs/xattr.c b/fs/cifs/xattr.c
> index 6e73ba9..721c6db 100644
> --- a/fs/cifs/xattr.c
> +++ b/fs/cifs/xattr.c
> @@ -61,15 +61,7 @@ int cifs_removexattr(struct dentry *direntry, const char *ea_name)
> }
> if (ea_name == NULL) {
> cifs_dbg(FYI, "Null xattr names not supported\n");
> - } else if (strncmp(ea_name, XATTR_USER_PREFIX, XATTR_USER_PREFIX_LEN)
> - && (strncmp(ea_name, XATTR_OS2_PREFIX, XATTR_OS2_PREFIX_LEN))) {
> - cifs_dbg(FYI,
> - "illegal xattr request %s (only user namespace supported)\n",
> - ea_name);
> - /* BB what if no namespace prefix? */
> - /* Should we just pass them to server, except for
> - system and perhaps security prefixes? */
> - } else {
> + } else if (!strncmp(ea_name, XATTR_USER_PREFIX, XATTR_USER_PREFIX_LEN)) {
> if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_XATTR)
> goto remove_ea_exit;
>
> @@ -78,6 +70,22 @@ int cifs_removexattr(struct dentry *direntry, const char *ea_name)
> rc = pTcon->ses->server->ops->set_EA(xid, pTcon,
> full_path, ea_name, NULL, (__u16)0,
> cifs_sb->local_nls, cifs_remap(cifs_sb));
> + } else if (!strncmp(ea_name, XATTR_OS2_PREFIX, XATTR_OS2_PREFIX_LEN)) {
> + if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_XATTR)
> + goto remove_ea_exit;
> +
> + ea_name += XATTR_OS2_PREFIX_LEN; /* skip past os2. prefix */
> + if (pTcon->ses->server->ops->set_EA)
> + rc = pTcon->ses->server->ops->set_EA(xid, pTcon,
> + full_path, ea_name, NULL, (__u16)0,
> + cifs_sb->local_nls, cifs_remap(cifs_sb));
> + } else {
> + cifs_dbg(FYI,
> + "illegal xattr request %s (only user namespace supported)\n",
> + ea_name);
> + /* BB what if no namespace prefix? */
> + /* Should we just pass them to server, except for
> + system and perhaps security prefixes? */
> }
> remove_ea_exit:
> kfree(full_path);
> --
> 2.4.11
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-cifs" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
Thanks,
Steve
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-CIFS-Fix-formatting-issues-on-previous-patches-spott.patch
Type: application/mbox
Size: 2876 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/cluster-devel/attachments/20160413/9afd70c0/attachment.mbox>
More information about the Cluster-devel
mailing list