Tao Ma
2009-Jul-30 08:07 UTC
[Ocfs2-devel] [PATCH] 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". Cc: Jan Kara <jack at suse.cz> Signed-off-by: Tao Ma <tao.ma at oracle.com> --- fs/ocfs2/quota_global.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/fs/ocfs2/quota_global.c b/fs/ocfs2/quota_global.c index edfa60c..e1c40e3 100644 --- a/fs/ocfs2/quota_global.c +++ b/fs/ocfs2/quota_global.c @@ -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) -- 1.6.0.4
Jan Kara
2009-Jul-30 11:07 UTC
[Ocfs2-devel] [PATCH] ocfs2/quota: Release lock for error in ocfs2_quota_write.
On Thu 30-07-09 16:07:10, Tao Ma wrote:> ocfs2_quota_write needs to release the lock if it fails to > read quota block. So use "goto out" instead of "return err". > > Cc: Jan Kara <jack at suse.cz> > Signed-off-by: Tao Ma <tao.ma at oracle.com>Ops, you are right. Acked-by: Jan Kara <jack at suse.cz> Honza> --- > fs/ocfs2/quota_global.c | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/fs/ocfs2/quota_global.c b/fs/ocfs2/quota_global.c > index edfa60c..e1c40e3 100644 > --- a/fs/ocfs2/quota_global.c > +++ b/fs/ocfs2/quota_global.c > @@ -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) > -- > 1.6.0.4 >-- Jan Kara <jack at suse.cz> SUSE Labs, CR
Joel Becker
2009-Jul-30 18:17 UTC
[Ocfs2-devel] [PATCH] ocfs2/quota: Release lock for error in ocfs2_quota_write.
On Thu, Jul 30, 2009 at 04:07:10PM +0800, Tao Ma wrote:> ocfs2_quota_write needs to release the lock if it fails to > read quota block. So use "goto out" instead of "return err". > > Cc: Jan Kara <jack at suse.cz> > Signed-off-by: Tao Ma <tao.ma at oracle.com>This fix is now in the fixes branch of ocfs2.git. Joel -- "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