diff options
Diffstat (limited to 'fs/ocfs2/xattr.c')
| -rw-r--r-- | fs/ocfs2/xattr.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/ocfs2/xattr.c b/fs/ocfs2/xattr.c index e87130f44cb7..98ee6c44102d 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)) |
| @@ -2135,6 +2136,7 @@ alloc_value: | |||
| 2135 | orig_clusters = ocfs2_xa_value_clusters(loc); | 2136 | orig_clusters = ocfs2_xa_value_clusters(loc); |
| 2136 | rc = ocfs2_xa_value_truncate(loc, xi->xi_value_len, ctxt); | 2137 | rc = ocfs2_xa_value_truncate(loc, xi->xi_value_len, ctxt); |
| 2137 | if (rc < 0) { | 2138 | if (rc < 0) { |
| 2139 | ctxt->set_abort = 1; | ||
| 2138 | ocfs2_xa_cleanup_value_truncate(loc, "growing", | 2140 | ocfs2_xa_cleanup_value_truncate(loc, "growing", |
| 2139 | orig_clusters); | 2141 | orig_clusters); |
| 2140 | /* | 2142 | /* |
| @@ -2946,7 +2948,7 @@ static int ocfs2_xattr_block_set(struct inode *inode, | |||
| 2946 | ret = ocfs2_xa_set(&loc, xi, ctxt); | 2948 | ret = ocfs2_xa_set(&loc, xi, ctxt); |
| 2947 | if (!ret) | 2949 | if (!ret) |
| 2948 | xs->here = loc.xl_entry; | 2950 | xs->here = loc.xl_entry; |
| 2949 | else if (ret != -ENOSPC) | 2951 | else if ((ret != -ENOSPC) || ctxt->set_abort) |
| 2950 | goto end; | 2952 | goto end; |
| 2951 | else { | 2953 | else { |
| 2952 | ret = ocfs2_xattr_create_index_block(inode, xs, ctxt); | 2954 | ret = ocfs2_xattr_create_index_block(inode, xs, ctxt); |
| @@ -3308,7 +3310,7 @@ static int __ocfs2_xattr_set_handle(struct inode *inode, | |||
| 3308 | goto out; | 3310 | goto out; |
| 3309 | } | 3311 | } |
| 3310 | ret = ocfs2_xattr_block_set(inode, xi, xbs, ctxt); | 3312 | ret = ocfs2_xattr_block_set(inode, xi, xbs, ctxt); |
| 3311 | } else if (ret == -ENOSPC) { | 3313 | } else if ((ret == -ENOSPC) && !ctxt->set_abort) { |
| 3312 | if (di->i_xattr_loc && !xbs->xattr_bh) { | 3314 | if (di->i_xattr_loc && !xbs->xattr_bh) { |
| 3313 | ret = ocfs2_xattr_block_find(inode, | 3315 | ret = ocfs2_xattr_block_find(inode, |
| 3314 | xi->xi_name_index, | 3316 | xi->xi_name_index, |
