aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/dlmglue.c
diff options
context:
space:
mode:
authorJoel Becker <Joel.Becker@oracle.com>2008-11-25 09:31:27 -0500
committerMark Fasheh <mfasheh@suse.com>2009-01-05 11:40:24 -0500
commit85eb8b73d66530bb7b931789ae7a5ec9744eed34 (patch)
tree4590be147364e0437f23a0d6bf72ccc900852eb9 /fs/ocfs2/dlmglue.c
parent57a09a7b3d9445a17c78d544f1e49d4d7d61705a (diff)
ocfs2: Fix ocfs2_read_quota_block() error handling.
ocfs2_bread() has become ocfs2_read_virt_blocks(), with a prototype to match ocfs2_read_blocks(). The quota code, converting from ocfs2_bread(), wraps the call to ocfs2_read_virt_blocks() in ocfs2_read_quota_block(). Unfortunately, the prototype of ocfs2_read_quota_block() matches the old prototype of ocfs2_bread(). The problem is that ocfs2_bread() returned the buffer head, and callers assumed that a NULL pointer was indicative of error. It wasn't. This is why ocfs2_bread() took an int*err argument as well. The new prototype of ocfs2_read_virt_blocks() avoids this error handling confusion. Let's change ocfs2_read_quota_block() to match. Signed-off-by: Joel Becker <joel.becker@oracle.com> Acked-by: Jan Kara <jack@suse.cz> Signed-off-by: Mark Fasheh <mfasheh@suse.com>
Diffstat (limited to 'fs/ocfs2/dlmglue.c')
-rw-r--r--fs/ocfs2/dlmglue.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/ocfs2/dlmglue.c b/fs/ocfs2/dlmglue.c
index 058aa86490ae..b1c75911d8ad 100644
--- a/fs/ocfs2/dlmglue.c
+++ b/fs/ocfs2/dlmglue.c
@@ -3519,7 +3519,7 @@ static int ocfs2_refresh_qinfo(struct ocfs2_mem_dqinfo *oinfo)
3519 oinfo->dqi_gi.dqi_type); 3519 oinfo->dqi_gi.dqi_type);
3520 struct ocfs2_lock_res *lockres = &oinfo->dqi_gqlock; 3520 struct ocfs2_lock_res *lockres = &oinfo->dqi_gqlock;
3521 struct ocfs2_qinfo_lvb *lvb = ocfs2_dlm_lvb(&lockres->l_lksb); 3521 struct ocfs2_qinfo_lvb *lvb = ocfs2_dlm_lvb(&lockres->l_lksb);
3522 struct buffer_head *bh; 3522 struct buffer_head *bh = NULL;
3523 struct ocfs2_global_disk_dqinfo *gdinfo; 3523 struct ocfs2_global_disk_dqinfo *gdinfo;
3524 int status = 0; 3524 int status = 0;
3525 3525
@@ -3532,8 +3532,8 @@ static int ocfs2_refresh_qinfo(struct ocfs2_mem_dqinfo *oinfo)
3532 oinfo->dqi_gi.dqi_free_entry = 3532 oinfo->dqi_gi.dqi_free_entry =
3533 be32_to_cpu(lvb->lvb_free_entry); 3533 be32_to_cpu(lvb->lvb_free_entry);
3534 } else { 3534 } else {
3535 bh = ocfs2_read_quota_block(oinfo->dqi_gqinode, 0, &status); 3535 status = ocfs2_read_quota_block(oinfo->dqi_gqinode, 0, &bh);
3536 if (!bh) { 3536 if (status) {
3537 mlog_errno(status); 3537 mlog_errno(status);
3538 goto bail; 3538 goto bail;
3539 } 3539 }