All of lore.kernel.org
 help / color / mirror / Atom feed
From: Venky Shankar <vshankar@redhat.com>
To: ceph-devel@vger.kernel.org
Cc: zyan@redhat.com
Subject: [RFC 2/2] ceph: do not return virtual xattrs in listxattr()
Date: Thu, 21 Jul 2016 12:19:18 +0530	[thread overview]
Message-ID: <1469083758-2153-2-git-send-email-vshankar@redhat.com> (raw)
In-Reply-To: <1469083758-2153-1-git-send-email-vshankar@redhat.com>

Signed-off-by: Venky Shankar <vshankar@redhat.com>
---
 fs/ceph/xattr.c | 27 ++-------------------------
 1 file changed, 2 insertions(+), 25 deletions(-)

diff --git a/fs/ceph/xattr.c b/fs/ceph/xattr.c
index d0f59cb..3b227aa 100644
--- a/fs/ceph/xattr.c
+++ b/fs/ceph/xattr.c
@@ -848,12 +848,8 @@ ssize_t ceph_listxattr(struct dentry *dentry, char *names, size_t size)
 {
 	struct inode *inode = d_inode(dentry);
 	struct ceph_inode_info *ci = ceph_inode(inode);
-	struct ceph_vxattr *vxattrs = ceph_inode_vxattrs(inode);
-	u32 vir_namelen = 0;
 	u32 namelen;
 	int err;
-	u32 len;
-	int i;
 
 	spin_lock(&ci->i_ceph_lock);
 	dout("listxattr %p ver=%lld index_ver=%lld\n", inode,
@@ -871,38 +867,19 @@ ssize_t ceph_listxattr(struct dentry *dentry, char *names, size_t size)
 	err = __build_xattrs(inode);
 	if (err < 0)
 		goto out;
-	/*
-	 * Start with virtual dir xattr names (if any) (including
-	 * terminating '\0' characters for each).
-	 */
-	vir_namelen = ceph_vxattrs_name_size(vxattrs);
 
 	/* adding 1 byte per each variable due to the null termination */
 	namelen = ci->i_xattrs.names_size + ci->i_xattrs.count;
 	err = -ERANGE;
-	if (size && vir_namelen + namelen > size)
+	if (size && namelen > size)
 		goto out;
 
-	err = namelen + vir_namelen;
+	err = namelen;
 	if (size == 0)
 		goto out;
 
 	names = __copy_xattr_names(ci, names);
 
-	/* virtual xattr names, too */
-	err = namelen;
-	if (vxattrs) {
-		for (i = 0; vxattrs[i].name; i++) {
-			if (!vxattrs[i].hidden &&
-			    !(vxattrs[i].exists_cb &&
-			      !vxattrs[i].exists_cb(ci))) {
-				len = sprintf(names, "%s", vxattrs[i].name);
-				names += len + 1;
-				err += len + 1;
-			}
-		}
-	}
-
 out:
 	spin_unlock(&ci->i_ceph_lock);
 	return err;
-- 
2.1.4


  reply	other threads:[~2016-07-21  6:49 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-21  6:49 [RFC 1/2] ceph: introduce 'ceph.all' virtual xattr Venky Shankar
2016-07-21  6:49 ` Venky Shankar [this message]
2016-07-21  7:30 ` Yan, Zheng
2016-07-21 12:17 ` [PATCH 0/2] ceph: virtual xattr handling Venky Shankar
2016-07-21 12:17   ` [PATCH 1/2] ceph: introduce 'ceph.all' virtual xattr Venky Shankar
2016-07-21 12:25     ` Yan, Zheng
2016-07-21 12:55       ` Venky Shankar
2016-07-21 12:17   ` [PATCH 2/2] ceph: do not return virtual xattrs in listxattr() Venky Shankar
2016-07-22  4:41   ` [PATCH 0/2] ceph: virtual xattr handling Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1469083758-2153-2-git-send-email-vshankar@redhat.com \
    --to=vshankar@redhat.com \
    --cc=ceph-devel@vger.kernel.org \
    --cc=zyan@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.