vserver 1.9.3
[linux-2.6.git] / fs / ext3 / xattr.c
index 5cbac5d..cedbcde 100644 (file)
@@ -791,8 +791,8 @@ ext3_xattr_set_handle2(handle_t *handle, struct inode *inode,
                                        EXT3_SB(sb)->s_es->s_first_data_block) +
                                EXT3_I(inode)->i_block_group *
                                EXT3_BLOCKS_PER_GROUP(sb);
-                       int block = ext3_new_block(handle,
-                               inode, goal, 0, 0, &error);
+                       int block = ext3_new_block(handle, inode, goal,
+                                                  NULL, NULL, &error);
                        if (error)
                                goto cleanup;
                        ea_idebug(inode, "creating block %d", block);
@@ -881,8 +881,9 @@ ext3_xattr_set(struct inode *inode, int name_index, const char *name,
               const void *value, size_t value_len, int flags)
 {
        handle_t *handle;
-       int error;
+       int error, retries = 0;
 
+retry:
        handle = ext3_journal_start(inode, EXT3_DATA_TRANS_BLOCKS);
        if (IS_ERR(handle)) {
                error = PTR_ERR(handle);
@@ -892,6 +893,9 @@ ext3_xattr_set(struct inode *inode, int name_index, const char *name,
                error = ext3_xattr_set_handle(handle, inode, name_index, name,
                                              value, value_len, flags);
                error2 = ext3_journal_stop(handle);
+               if (error == -ENOSPC &&
+                   ext3_should_retry_alloc(inode->i_sb, &retries))
+                       goto retry;
                if (error == 0)
                        error = error2;
        }
@@ -1133,7 +1137,7 @@ static inline void ext3_xattr_hash_entry(struct ext3_xattr_header *header,
        }
 
        if (entry->e_value_block == 0 && entry->e_value_size != 0) {
-               __u32 *value = (__u32 *)((char *)header +
+               __le32 *value = (__le32 *)((char *)header +
                        le16_to_cpu(entry->e_value_offs));
                for (n = (le32_to_cpu(entry->e_value_size) +
                     EXT3_XATTR_ROUND) >> EXT3_XATTR_PAD_BITS; n; n--) {