Skip to contentSkip to conversation

ocfs2/quota: Release lock for error in ocfs2_quota_write.

PATCH New Tao Ma 3 participants 3 messages Jul 30, 2009 OCFS2

lore
Share & tools
lore

Tao Ma

author
#0 lore raw

PATCH 1/1 ocfs2/quota: Release lock for error in ocfs2_quota_write.

ocfs2_quota_write needs to release the lock if it fails to read quota block. So use "goto out" instead of "return err".

---
 fs/ocfs2/quota_global.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
fs/ocfs2/quota_global.c +1 -1
index edfa60c..e1c40e3 100644
@@ -234,7 +234,7 @@ ssize_t ocfs2_quota_write(struct super_block *sb, int type,
 	}
 	if (err) {
 		mlog_errno(err);
-		return err;
+		goto out;
 	}
 	lock_buffer(bh);
 	if (new)
Signature · 1 line
1.6.0.4
#1 lore raw

PATCH 1/1 ocfs2/quota: Release lock for error in ocfs2_quota_write.

Quoted 5 lines · Tao Ma

ocfs2_quota_write needs to release the lock if it fails to read quota block. So use "goto out" instead of "return err".

Ops, you are right.

Honza

Quoted 20 lines
---
 fs/ocfs2/quota_global.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
fs/ocfs2/quota_global.c +1 -1
index edfa60c..e1c40e3 100644
@@ -234,7 +234,7 @@ ssize_t ocfs2_quota_write(struct super_block *sb, int type,
 	}
 	if (err) {
 		mlog_errno(err);
-		return err;
+		goto out;
 	}
 	lock_buffer(bh);
 	if (new)
Signature · 1 line
1.6.0.4
Signature · 2 lines
Jan Kara <[email protected]>
SUSE Labs, CR
#2 lore raw

PATCH 1/1 ocfs2/quota: Release lock for error in ocfs2_quota_write.

In reply to Tao Ma
Quoted 5 lines · Tao Ma

ocfs2_quota_write needs to release the lock if it fails to read quota block. So use "goto out" instead of "return err".

This fix is now in the fixes branch of ocfs2.git.

Joel

Signature · 8 lines
"Copy from one, it's plagiarism; copy from two, it's research."
        - Wilson Mizner

Joel Becker
Principal Software Developer
Oracle
E-mail: joel.becker at oracle.com
Phone: (650) 506-8127