Skip to content

Commit

Permalink
ocfs2: Specify appropriate journal access for new xattr buckets.
Browse files Browse the repository at this point in the history
There are a couple places that get an xattr bucket that may be reading
an existing one or may be allocating a new one.  They should specify the
correct journal access mode depending.

Signed-off-by: Joel Becker <joel.becker@oracle.com>
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
  • Loading branch information
Joel Becker authored and Mark Fasheh committed Nov 10, 2008
1 parent bd60bd3 commit eb6ff23
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion fs/ocfs2/xattr.c
Original file line number Diff line number Diff line change
Expand Up @@ -3231,7 +3231,9 @@ static int ocfs2_half_xattr_bucket(struct inode *inode,

for (i = 0; i < blk_per_bucket; i++) {
ret = ocfs2_journal_access(handle, inode, t_bhs[i],
OCFS2_JOURNAL_ACCESS_CREATE);
new_bucket_head ?
OCFS2_JOURNAL_ACCESS_CREATE :
OCFS2_JOURNAL_ACCESS_WRITE);
if (ret) {
mlog_errno(ret);
goto out;
Expand Down Expand Up @@ -3393,6 +3395,8 @@ static int ocfs2_cp_xattr_bucket(struct inode *inode,

for (i = 0; i < blk_per_bucket; i++) {
ret = ocfs2_journal_access(handle, inode, t_bhs[i],
t_is_new ?
OCFS2_JOURNAL_ACCESS_CREATE :
OCFS2_JOURNAL_ACCESS_WRITE);
if (ret)
goto out;
Expand Down

0 comments on commit eb6ff23

Please sign in to comment.