diff options
Diffstat (limited to 'fs/ocfs2/xattr.c')
| -rw-r--r-- | fs/ocfs2/xattr.c | 115 |
1 files changed, 47 insertions, 68 deletions
diff --git a/fs/ocfs2/xattr.c b/fs/ocfs2/xattr.c index 3e7773089b96..e97b34842cfe 100644 --- a/fs/ocfs2/xattr.c +++ b/fs/ocfs2/xattr.c | |||
| @@ -79,6 +79,7 @@ struct ocfs2_xattr_set_ctxt { | |||
| 79 | struct ocfs2_alloc_context *meta_ac; | 79 | struct ocfs2_alloc_context *meta_ac; |
| 80 | struct ocfs2_alloc_context *data_ac; | 80 | struct ocfs2_alloc_context *data_ac; |
| 81 | struct ocfs2_cached_dealloc_ctxt dealloc; | 81 | struct ocfs2_cached_dealloc_ctxt dealloc; |
| 82 | int set_abort; | ||
| 82 | }; | 83 | }; |
| 83 | 84 | ||
| 84 | #define OCFS2_XATTR_ROOT_SIZE (sizeof(struct ocfs2_xattr_def_value_root)) | 85 | #define OCFS2_XATTR_ROOT_SIZE (sizeof(struct ocfs2_xattr_def_value_root)) |
| @@ -96,7 +97,7 @@ static struct ocfs2_xattr_def_value_root def_xv = { | |||
| 96 | .xv.xr_list.l_count = cpu_to_le16(1), | 97 | .xv.xr_list.l_count = cpu_to_le16(1), |
| 97 | }; | 98 | }; |
| 98 | 99 | ||
| 99 | struct xattr_handler *ocfs2_xattr_handlers[] = { | 100 | const struct xattr_handler *ocfs2_xattr_handlers[] = { |
| 100 | &ocfs2_xattr_user_handler, | 101 | &ocfs2_xattr_user_handler, |
| 101 | &ocfs2_xattr_acl_access_handler, | 102 | &ocfs2_xattr_acl_access_handler, |
| 102 | &ocfs2_xattr_acl_default_handler, | 103 | &ocfs2_xattr_acl_default_handler, |
| @@ -105,7 +106,7 @@ struct xattr_handler *ocfs2_xattr_handlers[] = { | |||
| 105 | NULL | 106 | NULL |
| 106 | }; | 107 | }; |
| 107 | 108 | ||
| 108 | static struct xattr_handler *ocfs2_xattr_handler_map[OCFS2_XATTR_MAX] = { | 109 | static const struct xattr_handler *ocfs2_xattr_handler_map[OCFS2_XATTR_MAX] = { |
| 109 | [OCFS2_XATTR_INDEX_USER] = &ocfs2_xattr_user_handler, | 110 | [OCFS2_XATTR_INDEX_USER] = &ocfs2_xattr_user_handler, |
| 110 | [OCFS2_XATTR_INDEX_POSIX_ACL_ACCESS] | 111 | [OCFS2_XATTR_INDEX_POSIX_ACL_ACCESS] |
| 111 | = &ocfs2_xattr_acl_access_handler, | 112 | = &ocfs2_xattr_acl_access_handler, |
| @@ -539,7 +540,7 @@ static int ocfs2_read_xattr_block(struct inode *inode, u64 xb_blkno, | |||
| 539 | 540 | ||
| 540 | static inline const char *ocfs2_xattr_prefix(int name_index) | 541 | static inline const char *ocfs2_xattr_prefix(int name_index) |
| 541 | { | 542 | { |
| 542 | struct xattr_handler *handler = NULL; | 543 | const struct xattr_handler *handler = NULL; |
| 543 | 544 | ||
| 544 | if (name_index > 0 && name_index < OCFS2_XATTR_MAX) | 545 | if (name_index > 0 && name_index < OCFS2_XATTR_MAX) |
| 545 | handler = ocfs2_xattr_handler_map[name_index]; | 546 | handler = ocfs2_xattr_handler_map[name_index]; |
| @@ -739,11 +740,7 @@ static int ocfs2_xattr_extend_allocation(struct inode *inode, | |||
| 739 | goto leave; | 740 | goto leave; |
| 740 | } | 741 | } |
| 741 | 742 | ||
| 742 | status = ocfs2_journal_dirty(handle, vb->vb_bh); | 743 | ocfs2_journal_dirty(handle, vb->vb_bh); |
| 743 | if (status < 0) { | ||
| 744 | mlog_errno(status); | ||
| 745 | goto leave; | ||
| 746 | } | ||
| 747 | 744 | ||
| 748 | clusters_to_add -= le32_to_cpu(vb->vb_xv->xr_clusters) - prev_clusters; | 745 | clusters_to_add -= le32_to_cpu(vb->vb_xv->xr_clusters) - prev_clusters; |
| 749 | 746 | ||
| @@ -786,12 +783,7 @@ static int __ocfs2_remove_xattr_range(struct inode *inode, | |||
| 786 | } | 783 | } |
| 787 | 784 | ||
| 788 | le32_add_cpu(&vb->vb_xv->xr_clusters, -len); | 785 | le32_add_cpu(&vb->vb_xv->xr_clusters, -len); |
| 789 | 786 | ocfs2_journal_dirty(handle, vb->vb_bh); | |
| 790 | ret = ocfs2_journal_dirty(handle, vb->vb_bh); | ||
| 791 | if (ret) { | ||
| 792 | mlog_errno(ret); | ||
| 793 | goto out; | ||
| 794 | } | ||
| 795 | 787 | ||
| 796 | if (ext_flags & OCFS2_EXT_REFCOUNTED) | 788 | if (ext_flags & OCFS2_EXT_REFCOUNTED) |
| 797 | ret = ocfs2_decrease_refcount(inode, handle, | 789 | ret = ocfs2_decrease_refcount(inode, handle, |
| @@ -1374,11 +1366,7 @@ static int __ocfs2_xattr_set_value_outside(struct inode *inode, | |||
| 1374 | memset(bh->b_data + cp_len, 0, | 1366 | memset(bh->b_data + cp_len, 0, |
| 1375 | blocksize - cp_len); | 1367 | blocksize - cp_len); |
| 1376 | 1368 | ||
| 1377 | ret = ocfs2_journal_dirty(handle, bh); | 1369 | ocfs2_journal_dirty(handle, bh); |
| 1378 | if (ret < 0) { | ||
| 1379 | mlog_errno(ret); | ||
| 1380 | goto out; | ||
| 1381 | } | ||
| 1382 | brelse(bh); | 1370 | brelse(bh); |
| 1383 | bh = NULL; | 1371 | bh = NULL; |
| 1384 | 1372 | ||
| @@ -2148,15 +2136,19 @@ alloc_value: | |||
| 2148 | orig_clusters = ocfs2_xa_value_clusters(loc); | 2136 | orig_clusters = ocfs2_xa_value_clusters(loc); |
| 2149 | rc = ocfs2_xa_value_truncate(loc, xi->xi_value_len, ctxt); | 2137 | rc = ocfs2_xa_value_truncate(loc, xi->xi_value_len, ctxt); |
| 2150 | if (rc < 0) { | 2138 | if (rc < 0) { |
| 2151 | /* | 2139 | ctxt->set_abort = 1; |
| 2152 | * If we tried to grow an existing external value, | ||
| 2153 | * ocfs2_xa_cleanuP-value_truncate() is going to | ||
| 2154 | * let it stand. We have to restore its original | ||
| 2155 | * value size. | ||
| 2156 | */ | ||
| 2157 | loc->xl_entry->xe_value_size = orig_value_size; | ||
| 2158 | ocfs2_xa_cleanup_value_truncate(loc, "growing", | 2140 | ocfs2_xa_cleanup_value_truncate(loc, "growing", |
| 2159 | orig_clusters); | 2141 | orig_clusters); |
| 2142 | /* | ||
| 2143 | * If we were growing an existing value, | ||
| 2144 | * ocfs2_xa_cleanup_value_truncate() won't remove | ||
| 2145 | * the entry. We need to restore the original value | ||
| 2146 | * size. | ||
| 2147 | */ | ||
| 2148 | if (loc->xl_entry) { | ||
| 2149 | BUG_ON(!orig_value_size); | ||
| 2150 | loc->xl_entry->xe_value_size = orig_value_size; | ||
| 2151 | } | ||
| 2160 | mlog_errno(rc); | 2152 | mlog_errno(rc); |
| 2161 | } | 2153 | } |
| 2162 | } | 2154 | } |
| @@ -2479,7 +2471,10 @@ static int ocfs2_xattr_free_block(struct inode *inode, | |||
| 2479 | xb = (struct ocfs2_xattr_block *)blk_bh->b_data; | 2471 | xb = (struct ocfs2_xattr_block *)blk_bh->b_data; |
| 2480 | blk = le64_to_cpu(xb->xb_blkno); | 2472 | blk = le64_to_cpu(xb->xb_blkno); |
| 2481 | bit = le16_to_cpu(xb->xb_suballoc_bit); | 2473 | bit = le16_to_cpu(xb->xb_suballoc_bit); |
| 2482 | bg_blkno = ocfs2_which_suballoc_group(blk, bit); | 2474 | if (xb->xb_suballoc_loc) |
| 2475 | bg_blkno = le64_to_cpu(xb->xb_suballoc_loc); | ||
| 2476 | else | ||
| 2477 | bg_blkno = ocfs2_which_suballoc_group(blk, bit); | ||
| 2483 | 2478 | ||
| 2484 | xb_alloc_inode = ocfs2_get_system_file_inode(osb, | 2479 | xb_alloc_inode = ocfs2_get_system_file_inode(osb, |
| 2485 | EXTENT_ALLOC_SYSTEM_INODE, | 2480 | EXTENT_ALLOC_SYSTEM_INODE, |
| @@ -2594,9 +2589,7 @@ int ocfs2_xattr_remove(struct inode *inode, struct buffer_head *di_bh) | |||
| 2594 | di->i_dyn_features = cpu_to_le16(oi->ip_dyn_features); | 2589 | di->i_dyn_features = cpu_to_le16(oi->ip_dyn_features); |
| 2595 | spin_unlock(&oi->ip_lock); | 2590 | spin_unlock(&oi->ip_lock); |
| 2596 | 2591 | ||
| 2597 | ret = ocfs2_journal_dirty(handle, di_bh); | 2592 | ocfs2_journal_dirty(handle, di_bh); |
| 2598 | if (ret < 0) | ||
| 2599 | mlog_errno(ret); | ||
| 2600 | out_commit: | 2593 | out_commit: |
| 2601 | ocfs2_commit_trans(OCFS2_SB(inode->i_sb), handle); | 2594 | ocfs2_commit_trans(OCFS2_SB(inode->i_sb), handle); |
| 2602 | out: | 2595 | out: |
| @@ -2724,9 +2717,7 @@ static int ocfs2_xattr_ibody_init(struct inode *inode, | |||
| 2724 | di->i_dyn_features = cpu_to_le16(oi->ip_dyn_features); | 2717 | di->i_dyn_features = cpu_to_le16(oi->ip_dyn_features); |
| 2725 | spin_unlock(&oi->ip_lock); | 2718 | spin_unlock(&oi->ip_lock); |
| 2726 | 2719 | ||
| 2727 | ret = ocfs2_journal_dirty(ctxt->handle, di_bh); | 2720 | ocfs2_journal_dirty(ctxt->handle, di_bh); |
| 2728 | if (ret < 0) | ||
| 2729 | mlog_errno(ret); | ||
| 2730 | 2721 | ||
| 2731 | out: | 2722 | out: |
| 2732 | return ret; | 2723 | return ret; |
| @@ -2846,9 +2837,8 @@ static int ocfs2_create_xattr_block(struct inode *inode, | |||
| 2846 | int ret; | 2837 | int ret; |
| 2847 | u16 suballoc_bit_start; | 2838 | u16 suballoc_bit_start; |
| 2848 | u32 num_got; | 2839 | u32 num_got; |
| 2849 | u64 first_blkno; | 2840 | u64 suballoc_loc, first_blkno; |
| 2850 | struct ocfs2_dinode *di = (struct ocfs2_dinode *)inode_bh->b_data; | 2841 | struct ocfs2_dinode *di = (struct ocfs2_dinode *)inode_bh->b_data; |
| 2851 | struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); | ||
| 2852 | struct buffer_head *new_bh = NULL; | 2842 | struct buffer_head *new_bh = NULL; |
| 2853 | struct ocfs2_xattr_block *xblk; | 2843 | struct ocfs2_xattr_block *xblk; |
| 2854 | 2844 | ||
| @@ -2859,9 +2849,9 @@ static int ocfs2_create_xattr_block(struct inode *inode, | |||
| 2859 | goto end; | 2849 | goto end; |
| 2860 | } | 2850 | } |
| 2861 | 2851 | ||
| 2862 | ret = ocfs2_claim_metadata(osb, ctxt->handle, ctxt->meta_ac, 1, | 2852 | ret = ocfs2_claim_metadata(ctxt->handle, ctxt->meta_ac, 1, |
| 2863 | &suballoc_bit_start, &num_got, | 2853 | &suballoc_loc, &suballoc_bit_start, |
| 2864 | &first_blkno); | 2854 | &num_got, &first_blkno); |
| 2865 | if (ret < 0) { | 2855 | if (ret < 0) { |
| 2866 | mlog_errno(ret); | 2856 | mlog_errno(ret); |
| 2867 | goto end; | 2857 | goto end; |
| @@ -2883,8 +2873,10 @@ static int ocfs2_create_xattr_block(struct inode *inode, | |||
| 2883 | memset(xblk, 0, inode->i_sb->s_blocksize); | 2873 | memset(xblk, 0, inode->i_sb->s_blocksize); |
| 2884 | strcpy((void *)xblk, OCFS2_XATTR_BLOCK_SIGNATURE); | 2874 | strcpy((void *)xblk, OCFS2_XATTR_BLOCK_SIGNATURE); |
| 2885 | xblk->xb_suballoc_slot = cpu_to_le16(ctxt->meta_ac->ac_alloc_slot); | 2875 | xblk->xb_suballoc_slot = cpu_to_le16(ctxt->meta_ac->ac_alloc_slot); |
| 2876 | xblk->xb_suballoc_loc = cpu_to_le64(suballoc_loc); | ||
| 2886 | xblk->xb_suballoc_bit = cpu_to_le16(suballoc_bit_start); | 2877 | xblk->xb_suballoc_bit = cpu_to_le16(suballoc_bit_start); |
| 2887 | xblk->xb_fs_generation = cpu_to_le32(osb->fs_generation); | 2878 | xblk->xb_fs_generation = |
| 2879 | cpu_to_le32(OCFS2_SB(inode->i_sb)->fs_generation); | ||
| 2888 | xblk->xb_blkno = cpu_to_le64(first_blkno); | 2880 | xblk->xb_blkno = cpu_to_le64(first_blkno); |
| 2889 | if (indexed) { | 2881 | if (indexed) { |
| 2890 | struct ocfs2_xattr_tree_root *xr = &xblk->xb_attrs.xb_root; | 2882 | struct ocfs2_xattr_tree_root *xr = &xblk->xb_attrs.xb_root; |
| @@ -2956,7 +2948,7 @@ static int ocfs2_xattr_block_set(struct inode *inode, | |||
| 2956 | ret = ocfs2_xa_set(&loc, xi, ctxt); | 2948 | ret = ocfs2_xa_set(&loc, xi, ctxt); |
| 2957 | if (!ret) | 2949 | if (!ret) |
| 2958 | xs->here = loc.xl_entry; | 2950 | xs->here = loc.xl_entry; |
| 2959 | else if (ret != -ENOSPC) | 2951 | else if ((ret != -ENOSPC) || ctxt->set_abort) |
| 2960 | goto end; | 2952 | goto end; |
| 2961 | else { | 2953 | else { |
| 2962 | ret = ocfs2_xattr_create_index_block(inode, xs, ctxt); | 2954 | ret = ocfs2_xattr_create_index_block(inode, xs, ctxt); |
| @@ -3312,14 +3304,13 @@ static int __ocfs2_xattr_set_handle(struct inode *inode, | |||
| 3312 | goto out; | 3304 | goto out; |
| 3313 | } | 3305 | } |
| 3314 | 3306 | ||
| 3315 | ret = ocfs2_extend_trans(ctxt->handle, credits + | 3307 | ret = ocfs2_extend_trans(ctxt->handle, credits); |
| 3316 | ctxt->handle->h_buffer_credits); | ||
| 3317 | if (ret) { | 3308 | if (ret) { |
| 3318 | mlog_errno(ret); | 3309 | mlog_errno(ret); |
| 3319 | goto out; | 3310 | goto out; |
| 3320 | } | 3311 | } |
| 3321 | ret = ocfs2_xattr_block_set(inode, xi, xbs, ctxt); | 3312 | ret = ocfs2_xattr_block_set(inode, xi, xbs, ctxt); |
| 3322 | } else if (ret == -ENOSPC) { | 3313 | } else if ((ret == -ENOSPC) && !ctxt->set_abort) { |
| 3323 | if (di->i_xattr_loc && !xbs->xattr_bh) { | 3314 | if (di->i_xattr_loc && !xbs->xattr_bh) { |
| 3324 | ret = ocfs2_xattr_block_find(inode, | 3315 | ret = ocfs2_xattr_block_find(inode, |
| 3325 | xi->xi_name_index, | 3316 | xi->xi_name_index, |
| @@ -3343,8 +3334,7 @@ static int __ocfs2_xattr_set_handle(struct inode *inode, | |||
| 3343 | goto out; | 3334 | goto out; |
| 3344 | } | 3335 | } |
| 3345 | 3336 | ||
| 3346 | ret = ocfs2_extend_trans(ctxt->handle, credits + | 3337 | ret = ocfs2_extend_trans(ctxt->handle, credits); |
| 3347 | ctxt->handle->h_buffer_credits); | ||
| 3348 | if (ret) { | 3338 | if (ret) { |
| 3349 | mlog_errno(ret); | 3339 | mlog_errno(ret); |
| 3350 | goto out; | 3340 | goto out; |
| @@ -3378,8 +3368,7 @@ static int __ocfs2_xattr_set_handle(struct inode *inode, | |||
| 3378 | goto out; | 3368 | goto out; |
| 3379 | } | 3369 | } |
| 3380 | 3370 | ||
| 3381 | ret = ocfs2_extend_trans(ctxt->handle, credits + | 3371 | ret = ocfs2_extend_trans(ctxt->handle, credits); |
| 3382 | ctxt->handle->h_buffer_credits); | ||
| 3383 | if (ret) { | 3372 | if (ret) { |
| 3384 | mlog_errno(ret); | 3373 | mlog_errno(ret); |
| 3385 | goto out; | 3374 | goto out; |
| @@ -4249,7 +4238,6 @@ static int ocfs2_xattr_create_index_block(struct inode *inode, | |||
| 4249 | u32 bit_off, len; | 4238 | u32 bit_off, len; |
| 4250 | u64 blkno; | 4239 | u64 blkno; |
| 4251 | handle_t *handle = ctxt->handle; | 4240 | handle_t *handle = ctxt->handle; |
| 4252 | struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); | ||
| 4253 | struct ocfs2_inode_info *oi = OCFS2_I(inode); | 4241 | struct ocfs2_inode_info *oi = OCFS2_I(inode); |
| 4254 | struct buffer_head *xb_bh = xs->xattr_bh; | 4242 | struct buffer_head *xb_bh = xs->xattr_bh; |
| 4255 | struct ocfs2_xattr_block *xb = | 4243 | struct ocfs2_xattr_block *xb = |
| @@ -4277,7 +4265,7 @@ static int ocfs2_xattr_create_index_block(struct inode *inode, | |||
| 4277 | goto out; | 4265 | goto out; |
| 4278 | } | 4266 | } |
| 4279 | 4267 | ||
| 4280 | ret = __ocfs2_claim_clusters(osb, handle, ctxt->data_ac, | 4268 | ret = __ocfs2_claim_clusters(handle, ctxt->data_ac, |
| 4281 | 1, 1, &bit_off, &len); | 4269 | 1, 1, &bit_off, &len); |
| 4282 | if (ret) { | 4270 | if (ret) { |
| 4283 | mlog_errno(ret); | 4271 | mlog_errno(ret); |
| @@ -4887,8 +4875,7 @@ static int ocfs2_mv_xattr_buckets(struct inode *inode, handle_t *handle, | |||
| 4887 | * We need to update the first bucket of the old extent and all | 4875 | * We need to update the first bucket of the old extent and all |
| 4888 | * the buckets going to the new extent. | 4876 | * the buckets going to the new extent. |
| 4889 | */ | 4877 | */ |
| 4890 | credits = ((num_buckets + 1) * blks_per_bucket) + | 4878 | credits = ((num_buckets + 1) * blks_per_bucket); |
| 4891 | handle->h_buffer_credits; | ||
| 4892 | ret = ocfs2_extend_trans(handle, credits); | 4879 | ret = ocfs2_extend_trans(handle, credits); |
| 4893 | if (ret) { | 4880 | if (ret) { |
| 4894 | mlog_errno(ret); | 4881 | mlog_errno(ret); |
| @@ -4958,7 +4945,7 @@ static int ocfs2_divide_xattr_cluster(struct inode *inode, | |||
| 4958 | u32 *first_hash) | 4945 | u32 *first_hash) |
| 4959 | { | 4946 | { |
| 4960 | u16 blk_per_bucket = ocfs2_blocks_per_xattr_bucket(inode->i_sb); | 4947 | u16 blk_per_bucket = ocfs2_blocks_per_xattr_bucket(inode->i_sb); |
| 4961 | int ret, credits = 2 * blk_per_bucket + handle->h_buffer_credits; | 4948 | int ret, credits = 2 * blk_per_bucket; |
| 4962 | 4949 | ||
| 4963 | BUG_ON(OCFS2_XATTR_BUCKET_SIZE < OCFS2_SB(inode->i_sb)->s_clustersize); | 4950 | BUG_ON(OCFS2_XATTR_BUCKET_SIZE < OCFS2_SB(inode->i_sb)->s_clustersize); |
| 4964 | 4951 | ||
| @@ -5099,7 +5086,7 @@ static int ocfs2_add_new_xattr_cluster(struct inode *inode, | |||
| 5099 | goto leave; | 5086 | goto leave; |
| 5100 | } | 5087 | } |
| 5101 | 5088 | ||
| 5102 | ret = __ocfs2_claim_clusters(osb, handle, ctxt->data_ac, 1, | 5089 | ret = __ocfs2_claim_clusters(handle, ctxt->data_ac, 1, |
| 5103 | clusters_to_add, &bit_off, &num_bits); | 5090 | clusters_to_add, &bit_off, &num_bits); |
| 5104 | if (ret < 0) { | 5091 | if (ret < 0) { |
| 5105 | if (ret != -ENOSPC) | 5092 | if (ret != -ENOSPC) |
| @@ -5153,9 +5140,7 @@ static int ocfs2_add_new_xattr_cluster(struct inode *inode, | |||
| 5153 | goto leave; | 5140 | goto leave; |
| 5154 | } | 5141 | } |
| 5155 | 5142 | ||
| 5156 | ret = ocfs2_journal_dirty(handle, root_bh); | 5143 | ocfs2_journal_dirty(handle, root_bh); |
| 5157 | if (ret < 0) | ||
| 5158 | mlog_errno(ret); | ||
| 5159 | 5144 | ||
| 5160 | leave: | 5145 | leave: |
| 5161 | return ret; | 5146 | return ret; |
| @@ -5200,8 +5185,7 @@ static int ocfs2_extend_xattr_bucket(struct inode *inode, | |||
| 5200 | * existing bucket. Then we add the last existing bucket, the | 5185 | * existing bucket. Then we add the last existing bucket, the |
| 5201 | * new bucket, and the first bucket (3 * blk_per_bucket). | 5186 | * new bucket, and the first bucket (3 * blk_per_bucket). |
| 5202 | */ | 5187 | */ |
| 5203 | credits = (end_blk - target_blk) + (3 * blk_per_bucket) + | 5188 | credits = (end_blk - target_blk) + (3 * blk_per_bucket); |
| 5204 | handle->h_buffer_credits; | ||
| 5205 | ret = ocfs2_extend_trans(handle, credits); | 5189 | ret = ocfs2_extend_trans(handle, credits); |
| 5206 | if (ret) { | 5190 | if (ret) { |
| 5207 | mlog_errno(ret); | 5191 | mlog_errno(ret); |
| @@ -5477,12 +5461,7 @@ static int ocfs2_rm_xattr_cluster(struct inode *inode, | |||
| 5477 | } | 5461 | } |
| 5478 | 5462 | ||
| 5479 | le32_add_cpu(&xb->xb_attrs.xb_root.xt_clusters, -len); | 5463 | le32_add_cpu(&xb->xb_attrs.xb_root.xt_clusters, -len); |
| 5480 | 5464 | ocfs2_journal_dirty(handle, root_bh); | |
| 5481 | ret = ocfs2_journal_dirty(handle, root_bh); | ||
| 5482 | if (ret) { | ||
| 5483 | mlog_errno(ret); | ||
| 5484 | goto out_commit; | ||
| 5485 | } | ||
| 5486 | 5465 | ||
| 5487 | ret = ocfs2_truncate_log_append(osb, handle, blkno, len); | 5466 | ret = ocfs2_truncate_log_append(osb, handle, blkno, len); |
| 5488 | if (ret) | 5467 | if (ret) |
| @@ -6935,7 +6914,7 @@ static int ocfs2_reflink_xattr_rec(struct inode *inode, | |||
| 6935 | goto out; | 6914 | goto out; |
| 6936 | } | 6915 | } |
| 6937 | 6916 | ||
| 6938 | ret = ocfs2_claim_clusters(osb, handle, data_ac, | 6917 | ret = ocfs2_claim_clusters(handle, data_ac, |
| 6939 | len, &p_cluster, &num_clusters); | 6918 | len, &p_cluster, &num_clusters); |
| 6940 | if (ret) { | 6919 | if (ret) { |
| 6941 | mlog_errno(ret); | 6920 | mlog_errno(ret); |
| @@ -7234,7 +7213,7 @@ int ocfs2_init_security_set(handle_t *handle, | |||
| 7234 | xattr_ac, data_ac); | 7213 | xattr_ac, data_ac); |
| 7235 | } | 7214 | } |
| 7236 | 7215 | ||
| 7237 | struct xattr_handler ocfs2_xattr_security_handler = { | 7216 | const struct xattr_handler ocfs2_xattr_security_handler = { |
| 7238 | .prefix = XATTR_SECURITY_PREFIX, | 7217 | .prefix = XATTR_SECURITY_PREFIX, |
| 7239 | .list = ocfs2_xattr_security_list, | 7218 | .list = ocfs2_xattr_security_list, |
| 7240 | .get = ocfs2_xattr_security_get, | 7219 | .get = ocfs2_xattr_security_get, |
| @@ -7278,7 +7257,7 @@ static int ocfs2_xattr_trusted_set(struct dentry *dentry, const char *name, | |||
| 7278 | name, value, size, flags); | 7257 | name, value, size, flags); |
| 7279 | } | 7258 | } |
| 7280 | 7259 | ||
| 7281 | struct xattr_handler ocfs2_xattr_trusted_handler = { | 7260 | const struct xattr_handler ocfs2_xattr_trusted_handler = { |
| 7282 | .prefix = XATTR_TRUSTED_PREFIX, | 7261 | .prefix = XATTR_TRUSTED_PREFIX, |
| 7283 | .list = ocfs2_xattr_trusted_list, | 7262 | .list = ocfs2_xattr_trusted_list, |
| 7284 | .get = ocfs2_xattr_trusted_get, | 7263 | .get = ocfs2_xattr_trusted_get, |
| @@ -7334,7 +7313,7 @@ static int ocfs2_xattr_user_set(struct dentry *dentry, const char *name, | |||
| 7334 | name, value, size, flags); | 7313 | name, value, size, flags); |
| 7335 | } | 7314 | } |
| 7336 | 7315 | ||
| 7337 | struct xattr_handler ocfs2_xattr_user_handler = { | 7316 | const struct xattr_handler ocfs2_xattr_user_handler = { |
| 7338 | .prefix = XATTR_USER_PREFIX, | 7317 | .prefix = XATTR_USER_PREFIX, |
| 7339 | .list = ocfs2_xattr_user_list, | 7318 | .list = ocfs2_xattr_user_list, |
| 7340 | .get = ocfs2_xattr_user_get, | 7319 | .get = ocfs2_xattr_user_get, |
