-@@ -1007,6 +1021,8 @@ ext3_xattr_set_handle(handle_t *handle,
- if (!error) {
+@@ -944,13 +958,18 @@ ext3_xattr_set_handle(handle_t *handle,
+ struct ext3_xattr_block_find bs = {
+ .s = { .not_found = -ENODATA, },
+ };
++ unsigned long no_expand;
+ int error;
+
+ if (!name)
+ return -EINVAL;
+ if (strlen(name) > 255)
+ return -ERANGE;
++
+ down_write(&EXT3_I(inode)->xattr_sem);
++ no_expand = EXT3_I(inode)->i_state & EXT3_STATE_NO_EXPAND;
++ EXT3_I(inode)->i_state |= EXT3_STATE_NO_EXPAND;
++
+ error = ext3_get_inode_loc(inode, &is.iloc);
+ if (error)
+ goto cleanup;
+@@ -1008,6 +1027,8 @@ ext3_xattr_set_handle(handle_t *handle,