]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
kclient: some more xattr fixes
authorYehuda Sadeh <yehuda@hq.newdream.net>
Fri, 10 Apr 2009 23:01:55 +0000 (16:01 -0700)
committerYehuda Sadeh <yehuda@hq.newdream.net>
Thu, 16 Apr 2009 21:46:34 +0000 (14:46 -0700)
src/kernel/inode.c

index e1fa9fc8978fce7bb6d7e7a6b267259366ccad5f..90df668cfb07ea75acf6afbd7c53018e80c05ff0 100644 (file)
@@ -1657,13 +1657,13 @@ static int __set_xattr(struct ceph_inode_info *ci,
                        kfree((void *)xattr->val);
 
                if (should_free_name) {
-                       kfree((void *)name);
+                       kfree((void *)xattr->name);
                }
                ci->i_xattr_names_size -= (xattr->name_len + 1);
        }
        if (!xattr) {
                derr(0, "ENOMEM on %p %llx.%llx xattr %s=%s\n", &ci->vfs_inode,
-                    ceph_vinop(&ci->vfs_inode), name, val);
+                    ceph_vinop(&ci->vfs_inode), name, xattr->val);
                return -ENOMEM;
        }
        ci->i_xattr_names_size += name_len + 1;
@@ -1798,10 +1798,10 @@ static int __build_xattrs(struct ceph_inode_info *ci)
        void *p, *end;
        u32 len;
        const char *name, *val;
-
+#if 0
        if (ci->i_xattr_names_size)
                return 0; /* already built */
-
+#endif
        /* updated internal xattr rb tree */
        if (ci->i_xattr_len > 4) {
                p = ci->i_xattr_data;
@@ -2019,6 +2019,7 @@ int ceph_setxattr(struct dentry *dentry, const char *name,
                memcpy(newval, value, val_len + 1);
        }
 
+       dout(0, "setxattr newname=%s\n", newname);
        spin_lock(&inode->i_lock);
        __set_xattr(ci, newname, name_len, newval, val_len, 1, 1, 1);
        spin_unlock(&inode->i_lock);