diff options
Diffstat (limited to 'fs/ext4/xattr.c')
-rw-r--r-- | fs/ext4/xattr.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/fs/ext4/xattr.c b/fs/ext4/xattr.c index fa4b899da4b3..fc32176eee39 100644 --- a/fs/ext4/xattr.c +++ b/fs/ext4/xattr.c | |||
@@ -427,23 +427,23 @@ cleanup: | |||
427 | static int | 427 | static int |
428 | ext4_xattr_list(struct dentry *dentry, char *buffer, size_t buffer_size) | 428 | ext4_xattr_list(struct dentry *dentry, char *buffer, size_t buffer_size) |
429 | { | 429 | { |
430 | int i_error, b_error; | 430 | int ret, ret2; |
431 | 431 | ||
432 | down_read(&EXT4_I(dentry->d_inode)->xattr_sem); | 432 | down_read(&EXT4_I(dentry->d_inode)->xattr_sem); |
433 | i_error = ext4_xattr_ibody_list(dentry, buffer, buffer_size); | 433 | ret = ret2 = ext4_xattr_ibody_list(dentry, buffer, buffer_size); |
434 | if (i_error < 0) { | 434 | if (ret < 0) |
435 | b_error = 0; | 435 | goto errout; |
436 | } else { | 436 | if (buffer) { |
437 | if (buffer) { | 437 | buffer += ret; |
438 | buffer += i_error; | 438 | buffer_size -= ret; |
439 | buffer_size -= i_error; | ||
440 | } | ||
441 | b_error = ext4_xattr_block_list(dentry, buffer, buffer_size); | ||
442 | if (b_error < 0) | ||
443 | i_error = 0; | ||
444 | } | 439 | } |
440 | ret = ext4_xattr_block_list(dentry, buffer, buffer_size); | ||
441 | if (ret < 0) | ||
442 | goto errout; | ||
443 | ret += ret2; | ||
444 | errout: | ||
445 | up_read(&EXT4_I(dentry->d_inode)->xattr_sem); | 445 | up_read(&EXT4_I(dentry->d_inode)->xattr_sem); |
446 | return i_error + b_error; | 446 | return ret; |
447 | } | 447 | } |
448 | 448 | ||
449 | /* | 449 | /* |
@@ -947,7 +947,7 @@ ext4_xattr_ibody_set(handle_t *handle, struct inode *inode, | |||
947 | /* | 947 | /* |
948 | * ext4_xattr_set_handle() | 948 | * ext4_xattr_set_handle() |
949 | * | 949 | * |
950 | * Create, replace or remove an extended attribute for this inode. Buffer | 950 | * Create, replace or remove an extended attribute for this inode. Value |
951 | * is NULL to remove an existing extended attribute, and non-NULL to | 951 | * is NULL to remove an existing extended attribute, and non-NULL to |
952 | * either replace an existing extended attribute, or create a new extended | 952 | * either replace an existing extended attribute, or create a new extended |
953 | * attribute. The flags XATTR_REPLACE and XATTR_CREATE | 953 | * attribute. The flags XATTR_REPLACE and XATTR_CREATE |