Whamcloud - gitweb
b=22187 Handle the NULL pointer as legal value.
[fs/lustre-release.git] / lustre / llite / xattr.c
index 1d7a4f7..eecff63 100644 (file)
@@ -222,10 +222,10 @@ int ll_setxattr(struct dentry *dentry, const char *name,
                 /* Attributes that are saved via getxattr will always have
                  * the stripe_offset as 0.  Instead, the MDS should be
                  * allowed to pick the starting OST index.   b=17846 */
-                if (lump->lmm_stripe_offset == 0)
+                if (lump != NULL && lump->lmm_stripe_offset == 0)
                         lump->lmm_stripe_offset = -1;
 
-                if (S_ISREG(inode->i_mode)) {
+                if (lump != NULL && S_ISREG(inode->i_mode)) {
                         struct file f;
                         int flags = FMODE_WRITE;
 
@@ -315,9 +315,9 @@ int ll_getxattr_common(struct inode *inode, const char *name,
                 struct ll_inode_info *lli = ll_i2info(inode);
                 struct posix_acl *acl;
 
-                spin_lock(&lli->lli_lock);
+                cfs_spin_lock(&lli->lli_lock);
                 acl = posix_acl_dup(lli->lli_posix_acl);
-                spin_unlock(&lli->lli_lock);
+                cfs_spin_unlock(&lli->lli_lock);
 
                 if (!acl)
                         RETURN(-ENODATA);