diff options
| -rw-r--r-- | fs/ocfs2/xattr.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/fs/ocfs2/xattr.c b/fs/ocfs2/xattr.c index a1cf195935cf..e87130f44cb7 100644 --- a/fs/ocfs2/xattr.c +++ b/fs/ocfs2/xattr.c | |||
| @@ -2135,15 +2135,18 @@ alloc_value: | |||
| 2135 | orig_clusters = ocfs2_xa_value_clusters(loc); | 2135 | orig_clusters = ocfs2_xa_value_clusters(loc); |
| 2136 | rc = ocfs2_xa_value_truncate(loc, xi->xi_value_len, ctxt); | 2136 | rc = ocfs2_xa_value_truncate(loc, xi->xi_value_len, ctxt); |
| 2137 | if (rc < 0) { | 2137 | if (rc < 0) { |
| 2138 | /* | ||
| 2139 | * If we tried to grow an existing external value, | ||
| 2140 | * ocfs2_xa_cleanuP-value_truncate() is going to | ||
| 2141 | * let it stand. We have to restore its original | ||
| 2142 | * value size. | ||
| 2143 | */ | ||
| 2144 | loc->xl_entry->xe_value_size = orig_value_size; | ||
| 2145 | ocfs2_xa_cleanup_value_truncate(loc, "growing", | 2138 | ocfs2_xa_cleanup_value_truncate(loc, "growing", |
| 2146 | orig_clusters); | 2139 | orig_clusters); |
| 2140 | /* | ||
| 2141 | * If we were growing an existing value, | ||
| 2142 | * ocfs2_xa_cleanup_value_truncate() won't remove | ||
| 2143 | * the entry. We need to restore the original value | ||
| 2144 | * size. | ||
| 2145 | */ | ||
| 2146 | if (loc->xl_entry) { | ||
| 2147 | BUG_ON(!orig_value_size); | ||
| 2148 | loc->xl_entry->xe_value_size = orig_value_size; | ||
| 2149 | } | ||
| 2147 | mlog_errno(rc); | 2150 | mlog_errno(rc); |
| 2148 | } | 2151 | } |
| 2149 | } | 2152 | } |
