diff options
author | Sage Weil <sage@inktank.com> | 2013-01-31 14:53:41 -0500 |
---|---|---|
committer | Sage Weil <sage@inktank.com> | 2013-02-13 21:25:51 -0500 |
commit | 3adf654ddbc355c23d75c6684128d4b067a7b792 (patch) | |
tree | f667b613bfc1d08494628a4e4641cbf9ab30563f | |
parent | 8860147a01c4243f64f7d602dbf8342ca616ed45 (diff) |
ceph: pass unhandled ceph.* setxattrs through to MDS
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>
-rw-r--r-- | fs/ceph/xattr.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/ceph/xattr.c b/fs/ceph/xattr.c index 43063d0dee8f..edc47de77fed 100644 --- a/fs/ceph/xattr.c +++ b/fs/ceph/xattr.c | |||
@@ -777,6 +777,10 @@ int ceph_setxattr(struct dentry *dentry, const char *name, | |||
777 | if (vxattr && vxattr->readonly) | 777 | if (vxattr && vxattr->readonly) |
778 | return -EOPNOTSUPP; | 778 | return -EOPNOTSUPP; |
779 | 779 | ||
780 | /* pass any unhandled ceph.* xattrs through to the MDS */ | ||
781 | if (!strncmp(name, XATTR_CEPH_PREFIX, XATTR_CEPH_PREFIX_LEN)) | ||
782 | goto do_sync_unlocked; | ||
783 | |||
780 | /* preallocate memory for xattr name, value, index node */ | 784 | /* preallocate memory for xattr name, value, index node */ |
781 | err = -ENOMEM; | 785 | err = -ENOMEM; |
782 | newname = kmemdup(name, name_len + 1, GFP_NOFS); | 786 | newname = kmemdup(name, name_len + 1, GFP_NOFS); |
@@ -833,6 +837,7 @@ retry: | |||
833 | 837 | ||
834 | do_sync: | 838 | do_sync: |
835 | spin_unlock(&ci->i_ceph_lock); | 839 | spin_unlock(&ci->i_ceph_lock); |
840 | do_sync_unlocked: | ||
836 | err = ceph_sync_setxattr(dentry, name, value, size, flags); | 841 | err = ceph_sync_setxattr(dentry, name, value, size, flags); |
837 | out: | 842 | out: |
838 | kfree(newname); | 843 | kfree(newname); |