diff options
-rw-r--r-- | fs/ocfs2/xattr.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/fs/ocfs2/xattr.c b/fs/ocfs2/xattr.c index 127a6285078a..029a9f4559f1 100644 --- a/fs/ocfs2/xattr.c +++ b/fs/ocfs2/xattr.c | |||
@@ -4083,25 +4083,24 @@ static int ocfs2_xattr_set_entry_in_bucket(struct inode *inode, | |||
4083 | { | 4083 | { |
4084 | int ret; | 4084 | int ret; |
4085 | handle_t *handle = NULL; | 4085 | handle_t *handle = NULL; |
4086 | u16 blk_per_bucket = ocfs2_blocks_per_xattr_bucket(inode->i_sb); | ||
4087 | struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); | 4086 | struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); |
4087 | u64 blkno; | ||
4088 | 4088 | ||
4089 | mlog(0, "Set xattr entry len = %lu index = %d in bucket %llu\n", | 4089 | mlog(0, "Set xattr entry len = %lu index = %d in bucket %llu\n", |
4090 | (unsigned long)xi->value_len, xi->name_index, | 4090 | (unsigned long)xi->value_len, xi->name_index, |
4091 | (unsigned long long)bucket_blkno(xs->bucket)); | 4091 | (unsigned long long)bucket_blkno(xs->bucket)); |
4092 | 4092 | ||
4093 | if (!xs->bucket->bu_bhs[1]) { | 4093 | if (!xs->bucket->bu_bhs[1]) { |
4094 | ret = ocfs2_read_blocks(inode, | 4094 | blkno = bucket_blkno(xs->bucket); |
4095 | bucket_blkno(xs->bucket) + 1, | 4095 | ocfs2_xattr_bucket_relse(xs->bucket); |
4096 | blk_per_bucket - 1, &xs->bucket->bu_bhs[1], | 4096 | ret = ocfs2_read_xattr_bucket(xs->bucket, blkno); |
4097 | 0); | ||
4098 | if (ret) { | 4097 | if (ret) { |
4099 | mlog_errno(ret); | 4098 | mlog_errno(ret); |
4100 | goto out; | 4099 | goto out; |
4101 | } | 4100 | } |
4102 | } | 4101 | } |
4103 | 4102 | ||
4104 | handle = ocfs2_start_trans(osb, blk_per_bucket); | 4103 | handle = ocfs2_start_trans(osb, xs->bucket->bu_blocks); |
4105 | if (IS_ERR(handle)) { | 4104 | if (IS_ERR(handle)) { |
4106 | ret = PTR_ERR(handle); | 4105 | ret = PTR_ERR(handle); |
4107 | handle = NULL; | 4106 | handle = NULL; |