Skip to content

Commit

Permalink
ocfs2/xattr: Only set buffer update if it doesn't exist in cache.
Browse files Browse the repository at this point in the history
When we call ocfs2_init_xattr_bucket, we deem that the new buffer head
will be written to disk immediately, so we just use sb_getblk. But in
some cases the buffer may have already been in ocfs2 uptodate cache,
so we only call ocfs2_set_buffer_uptodate if the buffer head isn't
in the cache.

Signed-off-by: Tao Ma <tao.ma@oracle.com>
Signed-off-by: Joel Becker <joel.becker@oracle.com>
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
  • Loading branch information
Tao Ma authored and Mark Fasheh committed Jan 5, 2009
1 parent 1c32a2f commit 757055a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions fs/ocfs2/xattr.c
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,10 @@ static int ocfs2_init_xattr_bucket(struct ocfs2_xattr_bucket *bucket,
break;
}

ocfs2_set_new_buffer_uptodate(bucket->bu_inode,
bucket->bu_bhs[i]);
if (!ocfs2_buffer_uptodate(bucket->bu_inode,
bucket->bu_bhs[i]))
ocfs2_set_new_buffer_uptodate(bucket->bu_inode,
bucket->bu_bhs[i]);
}

if (rc)
Expand Down

0 comments on commit 757055a

Please sign in to comment.