diff options
-rw-r--r-- | fs/ocfs2/xattr.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/fs/ocfs2/xattr.c b/fs/ocfs2/xattr.c index 1a4de3dc2ba9..38e3e5e216bd 100644 --- a/fs/ocfs2/xattr.c +++ b/fs/ocfs2/xattr.c | |||
@@ -1336,8 +1336,9 @@ static int ocfs2_xattr_set_entry(struct inode *inode, | |||
1336 | } | 1336 | } |
1337 | 1337 | ||
1338 | if (!(flag & OCFS2_INLINE_XATTR_FL)) { | 1338 | if (!(flag & OCFS2_INLINE_XATTR_FL)) { |
1339 | /*set extended attribue in external blcok*/ | 1339 | /* set extended attribute in external block. */ |
1340 | ret = ocfs2_extend_trans(handle, | 1340 | ret = ocfs2_extend_trans(handle, |
1341 | OCFS2_INODE_UPDATE_CREDITS + | ||
1341 | OCFS2_XATTR_BLOCK_UPDATE_CREDITS); | 1342 | OCFS2_XATTR_BLOCK_UPDATE_CREDITS); |
1342 | if (ret) { | 1343 | if (ret) { |
1343 | mlog_errno(ret); | 1344 | mlog_errno(ret); |
@@ -3701,6 +3702,18 @@ static int ocfs2_add_new_xattr_cluster(struct inode *inode, | |||
3701 | } | 3702 | } |
3702 | } | 3703 | } |
3703 | 3704 | ||
3705 | if (handle->h_buffer_credits < credits) { | ||
3706 | /* | ||
3707 | * The journal has been restarted before, and don't | ||
3708 | * have enough space for the insertion, so extend it | ||
3709 | * here. | ||
3710 | */ | ||
3711 | ret = ocfs2_extend_trans(handle, credits); | ||
3712 | if (ret) { | ||
3713 | mlog_errno(ret); | ||
3714 | goto leave; | ||
3715 | } | ||
3716 | } | ||
3704 | mlog(0, "Insert %u clusters at block %llu for xattr at %u\n", | 3717 | mlog(0, "Insert %u clusters at block %llu for xattr at %u\n", |
3705 | num_bits, block, v_start); | 3718 | num_bits, block, v_start); |
3706 | ret = ocfs2_insert_extent(osb, handle, inode, &et, v_start, block, | 3719 | ret = ocfs2_insert_extent(osb, handle, inode, &et, v_start, block, |