Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 125905
b: refs/heads/master
c: 008aafa
h: refs/heads/master
i:
  125903: 43bcc74
v: v3
  • Loading branch information
Tiger Yang authored and Mark Fasheh committed Jan 5, 2009
1 parent 2272a0d commit 8b7e2d1
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0e445b6fe93c723fe8093fd04ddfeb11ae2de082
refs/heads/master: 008aafaf0b4aa0476da483e3c6e3edbe951811ff
18 changes: 15 additions & 3 deletions trunk/fs/ocfs2/xattr.c
Original file line number Diff line number Diff line change
Expand Up @@ -2611,9 +2611,7 @@ static int __ocfs2_xattr_set_handle(struct inode *inode,
/*
* This function only called duing creating inode
* for init security/acl xattrs of the new inode.
* The xattrs could be put into ibody or extent block,
* xattr bucket would not be use in this case.
* transanction credits also be reserved in here.
* All transanction credits have been reserved in mknod.
*/
int ocfs2_xattr_set_handle(handle_t *handle,
struct inode *inode,
Expand Down Expand Up @@ -2653,6 +2651,19 @@ int ocfs2_xattr_set_handle(handle_t *handle,
if (!ocfs2_supports_xattr(OCFS2_SB(inode->i_sb)))
return -EOPNOTSUPP;

/*
* In extreme situation, may need xattr bucket when
* block size is too small. And we have already reserved
* the credits for bucket in mknod.
*/
if (inode->i_sb->s_blocksize == OCFS2_MIN_BLOCKSIZE) {
xbs.bucket = ocfs2_xattr_bucket_new(inode);
if (!xbs.bucket) {
mlog_errno(-ENOMEM);
return -ENOMEM;
}
}

xis.inode_bh = xbs.inode_bh = di_bh;
di = (struct ocfs2_dinode *)di_bh->b_data;

Expand All @@ -2672,6 +2683,7 @@ int ocfs2_xattr_set_handle(handle_t *handle,
cleanup:
up_write(&OCFS2_I(inode)->ip_xattr_sem);
brelse(xbs.xattr_bh);
ocfs2_xattr_bucket_free(xbs.bucket);

return ret;
}
Expand Down

0 comments on commit 8b7e2d1

Please sign in to comment.