Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 112964
b: refs/heads/master
c: 4d20c68
h: refs/heads/master
v: v3
  • Loading branch information
Kalpak Shah authored and Theodore Ts'o committed Oct 9, 2008
1 parent 8fe3ac7 commit c2d7079
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 45a90bfd90c1215bf824c0f705b409723f52361b
refs/heads/master: 4d20c685fa365766a8f13584b4c8178a15ab7103
6 changes: 6 additions & 0 deletions trunk/fs/ext4/xattr.c
Original file line number Diff line number Diff line change
Expand Up @@ -959,13 +959,17 @@ ext4_xattr_set_handle(handle_t *handle, struct inode *inode, int name_index,
struct ext4_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(&EXT4_I(inode)->xattr_sem);
no_expand = EXT4_I(inode)->i_state & EXT4_STATE_NO_EXPAND;
EXT4_I(inode)->i_state |= EXT4_STATE_NO_EXPAND;

error = ext4_get_inode_loc(inode, &is.iloc);
if (error)
goto cleanup;
Expand Down Expand Up @@ -1042,6 +1046,8 @@ ext4_xattr_set_handle(handle_t *handle, struct inode *inode, int name_index,
cleanup:
brelse(is.iloc.bh);
brelse(bs.bh);
if (no_expand == 0)
EXT4_I(inode)->i_state &= ~EXT4_STATE_NO_EXPAND;
up_write(&EXT4_I(inode)->xattr_sem);
return error;
}
Expand Down

0 comments on commit c2d7079

Please sign in to comment.