Commit 4b3fa190 authored by Jan Kara's avatar Jan Kara Committed by Joel Becker

ocfs2: Mark buffer uptodate before calling ocfs2_journal_access_dq()

In a code path extending local quota files we marked new header
buffer uptodate only after calling ocfs2_journal_access_dq() which
triggers a bug. Fix it and also call ocfs2 variant of the function
marking buffer uptodate.
Signed-off-by: default avatarJan Kara <jack@suse.cz>
Signed-off-by: default avatarJoel Becker <joel.becker@oracle.com>
parent b57ac2c4
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#include "sysfile.h" #include "sysfile.h"
#include "dlmglue.h" #include "dlmglue.h"
#include "quota.h" #include "quota.h"
#include "uptodate.h"
/* Number of local quota structures per block */ /* Number of local quota structures per block */
static inline unsigned int ol_quota_entries_per_block(struct super_block *sb) static inline unsigned int ol_quota_entries_per_block(struct super_block *sb)
...@@ -979,6 +980,8 @@ static struct ocfs2_quota_chunk *ocfs2_local_quota_add_chunk( ...@@ -979,6 +980,8 @@ static struct ocfs2_quota_chunk *ocfs2_local_quota_add_chunk(
mlog_errno(status); mlog_errno(status);
goto out; goto out;
} }
ocfs2_set_new_buffer_uptodate(lqinode, bh);
dchunk = (struct ocfs2_local_disk_chunk *)bh->b_data; dchunk = (struct ocfs2_local_disk_chunk *)bh->b_data;
handle = ocfs2_start_trans(OCFS2_SB(sb), 2); handle = ocfs2_start_trans(OCFS2_SB(sb), 2);
...@@ -999,7 +1002,6 @@ static struct ocfs2_quota_chunk *ocfs2_local_quota_add_chunk( ...@@ -999,7 +1002,6 @@ static struct ocfs2_quota_chunk *ocfs2_local_quota_add_chunk(
memset(dchunk->dqc_bitmap, 0, memset(dchunk->dqc_bitmap, 0,
sb->s_blocksize - sizeof(struct ocfs2_local_disk_chunk) - sb->s_blocksize - sizeof(struct ocfs2_local_disk_chunk) -
OCFS2_QBLK_RESERVED_SPACE); OCFS2_QBLK_RESERVED_SPACE);
set_buffer_uptodate(bh);
unlock_buffer(bh); unlock_buffer(bh);
status = ocfs2_journal_dirty(handle, bh); status = ocfs2_journal_dirty(handle, bh);
if (status < 0) { if (status < 0) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment