aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ocfs2')
-rw-r--r--fs/ocfs2/xattr.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/fs/ocfs2/xattr.c b/fs/ocfs2/xattr.c
index 14b8c46b4fbb..016f01df3825 100644
--- a/fs/ocfs2/xattr.c
+++ b/fs/ocfs2/xattr.c
@@ -369,7 +369,7 @@ static void ocfs2_xattr_bucket_free(struct ocfs2_xattr_bucket *bucket)
369 * them fully. 369 * them fully.
370 */ 370 */
371static int ocfs2_init_xattr_bucket(struct ocfs2_xattr_bucket *bucket, 371static int ocfs2_init_xattr_bucket(struct ocfs2_xattr_bucket *bucket,
372 u64 xb_blkno) 372 u64 xb_blkno, int new)
373{ 373{
374 int i, rc = 0; 374 int i, rc = 0;
375 375
@@ -383,9 +383,16 @@ static int ocfs2_init_xattr_bucket(struct ocfs2_xattr_bucket *bucket,
383 } 383 }
384 384
385 if (!ocfs2_buffer_uptodate(INODE_CACHE(bucket->bu_inode), 385 if (!ocfs2_buffer_uptodate(INODE_CACHE(bucket->bu_inode),
386 bucket->bu_bhs[i])) 386 bucket->bu_bhs[i])) {
387 ocfs2_set_new_buffer_uptodate(INODE_CACHE(bucket->bu_inode), 387 if (new)
388 bucket->bu_bhs[i]); 388 ocfs2_set_new_buffer_uptodate(INODE_CACHE(bucket->bu_inode),
389 bucket->bu_bhs[i]);
390 else {
391 set_buffer_uptodate(bucket->bu_bhs[i]);
392 ocfs2_set_buffer_uptodate(INODE_CACHE(bucket->bu_inode),
393 bucket->bu_bhs[i]);
394 }
395 }
389 } 396 }
390 397
391 if (rc) 398 if (rc)
@@ -4303,7 +4310,7 @@ static int ocfs2_xattr_create_index_block(struct inode *inode,
4303 4310
4304 trace_ocfs2_xattr_create_index_block((unsigned long long)blkno); 4311 trace_ocfs2_xattr_create_index_block((unsigned long long)blkno);
4305 4312
4306 ret = ocfs2_init_xattr_bucket(xs->bucket, blkno); 4313 ret = ocfs2_init_xattr_bucket(xs->bucket, blkno, 1);
4307 if (ret) { 4314 if (ret) {
4308 mlog_errno(ret); 4315 mlog_errno(ret);
4309 goto out; 4316 goto out;
@@ -4647,7 +4654,7 @@ static int ocfs2_divide_xattr_bucket(struct inode *inode,
4647 * Even if !new_bucket_head, we're overwriting t_bucket. Thus, 4654 * Even if !new_bucket_head, we're overwriting t_bucket. Thus,
4648 * there's no need to read it. 4655 * there's no need to read it.
4649 */ 4656 */
4650 ret = ocfs2_init_xattr_bucket(t_bucket, new_blk); 4657 ret = ocfs2_init_xattr_bucket(t_bucket, new_blk, new_bucket_head);
4651 if (ret) { 4658 if (ret) {
4652 mlog_errno(ret); 4659 mlog_errno(ret);
4653 goto out; 4660 goto out;
@@ -4813,7 +4820,7 @@ static int ocfs2_cp_xattr_bucket(struct inode *inode,
4813 * Even if !t_is_new, we're overwriting t_bucket. Thus, 4820 * Even if !t_is_new, we're overwriting t_bucket. Thus,
4814 * there's no need to read it. 4821 * there's no need to read it.
4815 */ 4822 */
4816 ret = ocfs2_init_xattr_bucket(t_bucket, t_blkno); 4823 ret = ocfs2_init_xattr_bucket(t_bucket, t_blkno, t_is_new);
4817 if (ret) 4824 if (ret)
4818 goto out; 4825 goto out;
4819 4826
@@ -6840,7 +6847,7 @@ static int ocfs2_reflink_xattr_bucket(handle_t *handle,
6840 break; 6847 break;
6841 } 6848 }
6842 6849
6843 ret = ocfs2_init_xattr_bucket(args->new_bucket, new_blkno); 6850 ret = ocfs2_init_xattr_bucket(args->new_bucket, new_blkno, 1);
6844 if (ret) { 6851 if (ret) {
6845 mlog_errno(ret); 6852 mlog_errno(ret);
6846 break; 6853 break;