Skip to content

Commit

Permalink
ceph: pass unhandled ceph.* setxattrs through to MDS
Browse files Browse the repository at this point in the history
If we do not specifically understand a setxattr on a ceph.* virtual
xattr, send it through to the MDS.  This allows us to implement new
functionality via the MDS without direct support on the client side.

Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Sam Lang <sam.lang@inktank.com>
  • Loading branch information
Sage Weil committed Feb 14, 2013
1 parent 8860147 commit 3adf654
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions fs/ceph/xattr.c
Original file line number Diff line number Diff line change
Expand Up @@ -777,6 +777,10 @@ int ceph_setxattr(struct dentry *dentry, const char *name,
if (vxattr && vxattr->readonly)
return -EOPNOTSUPP;

/* pass any unhandled ceph.* xattrs through to the MDS */
if (!strncmp(name, XATTR_CEPH_PREFIX, XATTR_CEPH_PREFIX_LEN))
goto do_sync_unlocked;

/* preallocate memory for xattr name, value, index node */
err = -ENOMEM;
newname = kmemdup(name, name_len + 1, GFP_NOFS);
Expand Down Expand Up @@ -833,6 +837,7 @@ int ceph_setxattr(struct dentry *dentry, const char *name,

do_sync:
spin_unlock(&ci->i_ceph_lock);
do_sync_unlocked:
err = ceph_sync_setxattr(dentry, name, value, size, flags);
out:
kfree(newname);
Expand Down

0 comments on commit 3adf654

Please sign in to comment.