Re: [Ocfs2-devel] [PATCH] ocfs2: unlock rw lock if inode lock failed

2013-05-13 Thread Joseph Qi
On 2013/5/9 3:38, Andrew Morton wrote: > On Mon, 6 May 2013 22:43:39 +0800 Joseph Qi 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

Re: [Ocfs2-devel] [PATCH] ocfs2: unlock rw lock if inode lock failed

2013-05-08 Thread Sunil Mushran
It should almost never trigger. ocfs2_inode_lock() should always succeed and only return after it has gotten the required lock. On Wed, May 8, 2013 at 12:38 PM, Andrew Morton wrote: > On Mon, 6 May 2013 22:43:39 +0800 Joseph Qi wrote: > > > In ocfs2_file_aio_write, it does ocfs2_rw_lock first a

Re: [Ocfs2-devel] [PATCH] ocfs2: unlock rw lock if inode lock failed

2013-05-08 Thread Andrew Morton
On Mon, 6 May 2013 22:43:39 +0800 Joseph Qi 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, wh

Re: [Ocfs2-devel] [PATCH] ocfs2: unlock rw lock if inode lock failed

2013-05-06 Thread Sunil Mushran
Looks good to me. Acked-by: Sunil Mushran On Mon, May 6, 2013 at 7:43 AM, Joseph Qi 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_r

[Ocfs2-devel] [PATCH] ocfs2: unlock rw lock if inode lock failed

2013-05-06 Thread Joseph Qi
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 __o