X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Fllite%2Fxattr.c;h=1d9923eff2a5adf8fb7d5a389ced6dcc54ed4dbd;hb=21ec386df7314348e9d483008648524192b51054;hp=48b3fcb522ead95314b38f5d4e3fb4804b2bd0ac;hpb=f5fb215365791507ec98796ea624abeafa31901c;p=fs%2Flustre-release.git diff --git a/lustre/llite/xattr.c b/lustre/llite/xattr.c index 48b3fcb..1d9923e 100644 --- a/lustre/llite/xattr.c +++ b/lustre/llite/xattr.c @@ -27,7 +27,7 @@ * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2011, 2012, Whamcloud, Inc. + * Copyright (c) 2011, 2012, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ @@ -239,10 +239,12 @@ int ll_setxattr(struct dentry *dentry, const char *name, if (lump != NULL && S_ISREG(inode->i_mode)) { struct file f; int flags = FMODE_WRITE; + int lum_size = (lump->lmm_magic == LOV_USER_MAGIC_V1) ? + sizeof(*lump) : sizeof(struct lov_user_md_v3); - f.f_dentry = dentry; - rc = ll_lov_setstripe_ea_info(inode, &f, flags, - lump, sizeof(*lump)); + f.f_dentry = dentry; + rc = ll_lov_setstripe_ea_info(inode, &f, flags, lump, + lum_size); /* b10667: rc always be 0 here for now */ rc = 0; } else if (S_ISDIR(inode->i_mode)) { @@ -336,9 +338,9 @@ int ll_getxattr_common(struct inode *inode, const char *name, struct ll_inode_info *lli = ll_i2info(inode); struct posix_acl *acl; - cfs_spin_lock(&lli->lli_lock); - acl = posix_acl_dup(lli->lli_posix_acl); - cfs_spin_unlock(&lli->lli_lock); + spin_lock(&lli->lli_lock); + acl = posix_acl_dup(lli->lli_posix_acl); + spin_unlock(&lli->lli_lock); if (!acl) RETURN(-ENODATA);