From: Joseph Qi <joseph.qi@huawei.com>
To: ocfs2-devel@oss.oracle.com
Subject: [Ocfs2-devel] [PATCH] ocfs2: unlock rw lock if inode lock failed
Date: Tue, 14 May 2013 12:57:19 +0800 [thread overview]
Message-ID: <5191C42F.6050507@huawei.com> (raw)
In-Reply-To: <20130508123858.f22b8a5157f09f9014e34e25@linux-foundation.org>
On 2013/5/9 3:38, Andrew Morton wrote:
> On Mon, 6 May 2013 22:43:39 +0800 Joseph Qi <joseph.qi@huawei.com> wrote:
>
>> In ocfs2_file_aio_write, it does ocfs2_rw_lock first and then
>> ocfs2_inode_lock. But if ocfs2_inode_lock failed, it goes to out_sems
>> without unlocking rw lock. This will cause a bug in ocfs2_lock_res_free
>> when testing res->l_ex_holders, which is increased in
>> __ocfs2_cluster_lock and decreased in __ocfs2_cluster_unlock.
>>
>> ...
>>
>> --- a/fs/ocfs2/file.c
>> +++ b/fs/ocfs2/file.c
>> @@ -2290,7 +2290,7 @@ relock:
>> ret = ocfs2_inode_lock(inode, NULL, 1);
>> if (ret < 0) {
>> mlog_errno(ret);
>> - goto out_sems;
>> + goto out;
>> }
>>
>> ocfs2_inode_unlock(inode, 1);
>
> That seems like a fairly serious bug. How long has it been there and
> what userspace actions are required to trigger it?
>
> (I'm trying to work out which kernel versions we should merge the
> fix into, but the changelog didn't give me enough info to determine
> this)
>
> .
>
Sorry for the delayed reply.
The reproducible case is lots of write IOs plus storage link down and
then restore.
And my kernel is 3.0.13.
prev parent reply other threads:[~2013-05-14 4:57 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-06 14:43 [Ocfs2-devel] [PATCH] ocfs2: unlock rw lock if inode lock failed Joseph Qi
2013-05-06 16:34 ` Sunil Mushran
2013-05-08 19:38 ` Andrew Morton
2013-05-08 20:23 ` Sunil Mushran
2013-05-14 4:57 ` Joseph Qi [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5191C42F.6050507@huawei.com \
--to=joseph.qi@huawei.com \
--cc=ocfs2-devel@oss.oracle.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.