[Ocfs2-devel] [PATCH v2] ocfs2: fix possible memory leak in dlm_process_recovery_data

2013-05-02 Thread Joseph Qi
We found a possible memory leak in dlm_process_recovery_data when doing code review. In dlm_process_recovery_data, it creates newlock each time, but don't free when it is bad, and then it will lead to memory leak. Cc: sta...@vger.kernel.org Signed-off-by: Joseph Qi joseph...@huawei.com Reviewed

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 joseph...@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

[Ocfs2-devel] [PATCH] ocfs2: goto out_unlock if ocfs2_get_clusters_nocache failed in ocfs2_fiemap

2013-05-14 Thread Joseph Qi
ocfs2_get_clusters_nocache failed, it should goto out_unlock instead of out, because we need release buffer head, up read alloc sem and unlock inode. Cc: sta...@vger.kernel.org Signed-off-by: Joseph Qi joseph...@huawei.com --- fs/ocfs2/extent_map.c |2 +- 1 file changed, 1 insertion(+), 1

[Ocfs2-devel] [PATCH v2] ocfs2: goto out_unlock if ocfs2_get_clusters_nocache failed in ocfs2_fiemap

2013-05-14 Thread Joseph Qi
, once ocfs2_get_clusters_nocache failed, it should goto out_unlock instead of out, because we need release buffer head, up read alloc sem and unlock inode. Cc: sta...@vger.kernel.org Signed-off-by: Joseph Qi joseph...@huawei.com Reviewed-by: Jie Liu jeff@oracle.com --- fs/ocfs2/extent_map.c

[Ocfs2-devel] [PATCH] clean up duplicate declaration in dlmrecovery.c

2013-05-20 Thread Joseph Qi
Below 3 functions have already been declared in dlmcommon.h, so we have no need to declare them again in dlmrecovery.c. dlm_complete_recovery_thread dlm_launch_recovery_thread dlm_kick_recovery_thread Signed-off-by: Joseph Qi joseph...@huawei.com --- fs/ocfs2/dlm/dlmrecovery.c |3 --- 1

[Ocfs2-devel] [PATCH] ret should be int instead of enum in dlm_request_all_locks

2013-05-22 Thread Joseph Qi
In dlm_request_all_locks, ret is type enum. But o2net_send_message returns a type int value. Then it will never run into the following error branch. So we should change the ret type from enum to int. Signed-off-by: Joseph Qi joseph...@huawei.com --- fs/ocfs2/dlm/dlmrecovery.c |3 +-- 1 file

Re: [Ocfs2-devel] [patch 1/4] ocfs2: fix a couple of memory leaks at o2hb_map_slot_data()

2013-05-27 Thread Joseph Qi
These memory will be freed in o2hb_region_release. If we free them here, then it will lead to double freed issue. This patch can fix a couple of potential memory leaks at o2hb_map_slot_data(). Signed-off-by: Jie Liu jeff.liu at oracle.com --- fs/ocfs2/cluster/heartbeat.c | 33

[Ocfs2-devel] [PATCH] ocfs2: should not use le32_add_cpu to set ocfs2_dinode i_flags

2013-05-28 Thread Joseph Qi
If we use le32_add_cpu to set ocfs2_dinode i_flags, it may lead to the corresponding flag corrupted. So we should change it to bitwise and/or operation. Signed-off-by: Joseph Qi joseph...@huawei.com --- fs/ocfs2/namei.c |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git

Re: [Ocfs2-devel] ocfs2: kernel BUG at fs/ocfs2/buffer_head_io.c

2013-05-28 Thread Joseph Qi
Anyone can give me some advice? On 2013/5/26 20:21, Joseph Qi wrote: I have triggered a BUG at buffer_head_io.c. Belowing is the code where the BUG is triggered: if (buffer_needs_validate(bh)) { /* We never set NeedsValidate if the * buffer was held by the journal, so

Re: [Ocfs2-devel] [PATCH] ocfs2: should not use le32_add_cpu to set ocfs2_dinode i_flags

2013-05-29 Thread Joseph Qi
You are right. Thanks for your review comments. I will do the corresponding modification and resend the patch. On 2013/5/29 18:17, Jeff Liu wrote: On 05/29/2013 04:12 PM, shencanquan wrote: On 2013/5/29 15:57, Jeff Liu wrote: Thanks for your patch, Joseph. On 05/29/2013 10:42 AM, Joseph Qi

Re: [Ocfs2-devel] ocfs2: kernel BUG at fs/ocfs2/buffer_head_io.c

2013-06-01 Thread Joseph Qi
at 11:38:49AM +0800, Joseph Qi wrote: Anyone can give me some advice? On 2013/5/26 20:21, Joseph Qi wrote: I have triggered a BUG at buffer_head_io.c. Belowing is the code where the BUG is triggered: if (buffer_needs_validate(bh)) { /* We never set NeedsValidate if the * buffer

[Ocfs2-devel] [PATCH 1/2] cannot metex_unlock without mutex_lock in ocfs2_remove_btree_range

2013-06-10 Thread Joseph Qi
In ocfs2_remove_btree_range, when calling ocfs2_lock_refcount_tree and ocfs2_prepare_refcount_change_for_del failed, it goes to out and then tries to call mutex_unlock without mutex_lock before. Signed-off-by: Joseph Qi joseph...@huawei.com --- fs/ocfs2/alloc.c |6 +++--- 1 file changed, 3

[Ocfs2-devel] [PATCH 2/2] should free ref_tree before return in ocfs2_remove_btree_range

2013-06-10 Thread Joseph Qi
In ocfs2_remove_btree_range, when ocfs2_reserve_blocks_for_rec_trunc failed, it should ref_tree before return. Signed-off-by: Joseph Qi joseph...@huawei.com --- fs/ocfs2/alloc.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/ocfs2/alloc.c b/fs/ocfs2/alloc.c index

Re: [Ocfs2-devel] [PATCH 1/2] cannot metex_unlock without mutex_lock in ocfs2_remove_btree_range

2013-06-10 Thread Joseph Qi
On 2013/6/10 15:14, Jeff Liu wrote: On 06/10/2013 02:27 PM, Joseph Qi wrote: In ocfs2_remove_btree_range, when calling ocfs2_lock_refcount_tree and ocfs2_prepare_refcount_change_for_del failed, it goes to out and then tries to call mutex_unlock without mutex_lock before. It's better

[Ocfs2-devel] [PATCH v2] ocfs2: fix mutex_unlock and possible memory leak in ocfs2_remove_btree_range

2013-06-10 Thread Joseph Qi
. Signed-off-by: Joseph Qi joseph...@huawei.com --- fs/ocfs2/alloc.c |8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fs/ocfs2/alloc.c b/fs/ocfs2/alloc.c index b8a9d87..17e6bdd 100644 --- a/fs/ocfs2/alloc.c +++ b/fs/ocfs2/alloc.c @@ -5655,7 +5655,7 @@ int

[Ocfs2-devel] ocfs2: Should move ocfs2_start_trans out of lock_page

2013-06-19 Thread Joseph Qi
Currently ocfs2_start_trans/ocfs2_commit_trans are in lock_page/unlock_page. This may cause dead lock. Here is the situation: write - lock_page - ocfs2_start_trans - ocfs2_commit_trans - unlock_page ocfs2_start_trans/ocfs2_commit_trans calls jbd2_journal_start/jbd2_journal_stop which may also

Re: [Ocfs2-devel] ocfs2: Should move ocfs2_start_trans out of lock_page

2013-06-24 Thread Joseph Qi
Any different opinion? On 2013/6/19 16:17, Joseph Qi wrote: Currently ocfs2_start_trans/ocfs2_commit_trans are in lock_page/unlock_page. This may cause dead lock. Here is the situation: write - lock_page - ocfs2_start_trans - ocfs2_commit_trans - unlock_page ocfs2_start_trans

Re: [Ocfs2-devel] ocfs2: Should move ocfs2_start_trans out of lock_page

2013-06-29 Thread Joseph Qi
actions. Joel On Mon, Jun 24, 2013 at 04:55:20PM +0800, Joseph Qi wrote: Any different opinion? On 2013/6/19 16:17, Joseph Qi wrote: Currently ocfs2_start_trans/ocfs2_commit_trans are in lock_page/unlock_page. This may cause dead lock. Here is the situation: write - lock_page

[Ocfs2-devel] [PATCH] ocfs2: add the missing return value check of ocfs2_xattr_get_clusters

2013-07-31 Thread Joseph Qi
In ocfs2_xattr_value_attach_refcount(), if error occurs when calling ocfs2_xattr_get_clusters(), it will go with unexpected behavior since local variables p_cluster, num_clusters and ext_flags are declared without initialization. Signed-off-by: Joseph Qi joseph...@huawei.com --- fs/ocfs2/xattr.c

Re: [Ocfs2-devel] [PATCH] ocfs2: add the missing return value check of ocfs2_get_clusters

2013-08-01 Thread Joseph Qi
On 2013/8/1 17:25, Jeff Liu wrote: On 08/01/2013 05:14 PM, Joseph Qi wrote: In ocfs2_attach_refcount_tree() and ocfs2_duplicate_extent_list(), if error occurs when calling ocfs2_get_clusters(), it will go with unexpected behavior as local variables p_cluster, num_clusters and ext_flags

[Ocfs2-devel] [PATCH] ocfs2: adjust code style for o2net_handler_tree_lookup()

2013-08-11 Thread Joseph Qi
Code in o2net_handler_tree_lookup() may be corrupted by mistake. So adjust it to promote readability. Signed-off-by: Joseph Qi joseph...@huawei.com --- fs/ocfs2/cluster/tcp.c | 34 +- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/fs/ocfs2

Re: [Ocfs2-devel] [PATCH] ocfs2: fix a tiny race case when fire callbacks

2013-08-27 Thread Joseph Qi
On 2013/8/28 4:54, Andrew Morton wrote: On Tue, 27 Aug 2013 14:17:17 +0800 Joseph Qi joseph...@huawei.com wrote: Signed-off-by: Joyce xuejiu...@huawei.com Signed-off-by: Joseph Qi joseph...@huawei.com This signoff trail makes me wonder: which of you was the primary author of this patch

Re: [Ocfs2-devel] [PATCH 1/1] ocfs2/dlm: ocfs2 dlm umount skip migrating lockres

2013-09-11 Thread Joseph Qi
On 2013/9/12 2:40, Tariq Saeed wrote: umount thread could race with migrate handler thread receiving resource migration request from other node. When this happens, migrating thread could set this node as the master along with DLM_LOCK_RES_MIGRATING flag. umount thread should skip migrating

Re: [Ocfs2-devel] [PATCH RESEND 1/2] ocfs2: return ENOMEM while sb_getblk failing

2013-09-16 Thread Joseph Qi
On 2013/9/7 0:44, Mark Fasheh wrote: This looks great, thank you. Reviewed-by: Mark Fasheh mfas...@suse.de On Thu, Sep 05, 2013 at 04:28:54PM +0800, Rui Xiang wrote: The only reason for sb_getblk() failing is if it can't allocate the buffer_head. So return ENOMEM instead when it fails.

Re: [Ocfs2-devel] [PATCH RESEND 2/2] ocfs2: add necessary check in case sb_getblk fails

2013-09-16 Thread Joseph Qi
On 2013/9/7 0:45, Mark Fasheh wrote: Reviewed-by: Mark Fasheh mfas...@suse.de On Thu, Sep 05, 2013 at 04:28:55PM +0800, Rui Xiang wrote: Sb_getblk may retrun an err, so add a check for bh. Signed-off-by: Rui Xiang rui.xi...@huawei.com Reviewed-by: Jie Liu jeff@oracle.com ---

[Ocfs2-devel] [PATCH] ocfs2: free allocated clusters if error occurs after ocfs2_claim_clusters

2013-11-21 Thread Joseph Qi
successfully when expanding a file, but failed in ocfs2_insert_extent. So we need free the allocated clusters if they are not used indeed. Cc: Joseph Qi joseph...@huawei.com Signed-off-by: Zongxun Wang wangzong...@huawei.com --- fs/ocfs2/alloc.c | 38 +++--- fs/ocfs2

[Ocfs2-devel] [PATCH Resend] ocfs2: free allocated clusters if error occurs after ocfs2_claim_clusters

2013-11-21 Thread Joseph Qi
successfully when expanding a file, but failed in ocfs2_insert_extent. So we need free the allocated clusters if they are not used indeed. Signed-off-by: Zongxun Wang wangzong...@huawei.com Signed-off-by: Joseph Qi joseph...@huawei.com --- fs/ocfs2/alloc.c | 38

[Ocfs2-devel] [PATCH] ocfs2: correctly update i_used in ocfs2_free_local_alloc_bits

2013-11-24 Thread Joseph Qi
. Signed-off-by: Joseph Qi joseph...@huawei.com --- fs/ocfs2/localalloc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fs/ocfs2/localalloc.c b/fs/ocfs2/localalloc.c index 25ec3b7..0440134 100644 --- a/fs/ocfs2/localalloc.c +++ b/fs/ocfs2/localalloc.c @@ -788,6 +788,7 @@ int

Re: [Ocfs2-devel] [PATCH] ocfs2: drop the unwanted null byte in dentry lock name

2013-11-27 Thread Joseph Qi
On 2013/11/28 7:38, Andrew Morton wrote: On Wed, 27 Nov 2013 17:05:00 +0800 Joseph Qi joseph...@huawei.com wrote: Dentry lock name is made up of the type 'N', the parent blkno and its blkno represented as a binary value. Now there is a null byte between parent blkno and the binary blkno

Re: [Ocfs2-devel] ocfs2: a dead lock case when running dirop_fileop_racer

2013-11-27 Thread Joseph Qi
On 2013/11/8 10:19, Joseph Qi wrote: On 2013/11/7 21:19, Joel Becker wrote: On Thu, Nov 07, 2013 at 08:12:02PM +0800, Joseph Qi wrote: We ran ocfs2 test program dirop_fileop_racer and found a dead lock case. The case is described below. 2 nodes, say Node A and Node B, mount the same ocfs2

Re: [Ocfs2-devel] [PATCH] ocfs2: drop the unwanted null byte in dentry lock name

2013-11-29 Thread Joseph Qi
On 2013/11/29 0:40, Mark Fasheh wrote: On Wed, Nov 27, 2013 at 03:38:41PM -0800, Andrew Morton wrote: On Wed, 27 Nov 2013 17:05:00 +0800 Joseph Qi joseph...@huawei.com wrote: Dentry lock name is made up of the type 'N', the parent blkno and its blkno represented as a binary value. Now

[Ocfs2-devel] [PATCH] ocfs2: fix a tiny race when running dirop_fileop_racer

2013-12-15 Thread Joseph Qi
. Signed-off-by: Yiwen Jiang jiangyi...@huawei.com Signed-off-by: Joseph Qi joseph...@huawei.com --- fs/ocfs2/namei.c | 97 ++-- 1 file changed, 95 insertions(+), 2 deletions(-) diff --git a/fs/ocfs2/namei.c b/fs/ocfs2/namei.c index be3f867

[Ocfs2-devel] [PATCH] ocfs2: Fix NULL pointer dereference when dismount and ocfs2rec simultaneously

2013-12-26 Thread Joseph Qi
Signed-off-by: Joseph Qi joseph...@huawei.com --- fs/ocfs2/super.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c index c414929..665e91e 100644 --- a/fs/ocfs2/super.c +++ b/fs/ocfs2/super.c @@ -1947,11 +1947,15 @@ static void

Re: [Ocfs2-devel] [PATCH 1/1] o2dlm: fix NULL pointer dereference in o2dlm_blocking_ast_wrapper

2014-01-13 Thread Joseph Qi
On 2014/1/11 9:19, Srinivas Eeda wrote: From: Srinivas Eeda seeda@srini.(none) A tiny race between BAST and unlock message causes the NULL dereference. A node sends an unlock request to master and receives a response. Before processing the response it receives a BAST from the master. Since

Re: [Ocfs2-devel] [patch 02/11] ocfs2: free allocated clusters if error occurs after ocfs2_claim_clusters

2014-01-25 Thread Joseph Qi
-by: Zongxun Wang wangzong...@huawei.com Signed-off-by: Joseph Qi joseph...@huawei.com Cc: Joel Becker jl...@evilplan.org Cc: Mark Fasheh mfas...@suse.com Cc: Li Zefan lize...@huawei.com Signed-off-by: Andrew Morton a...@linux-foundation.org --- fs/ocfs2/alloc.c | 38

Re: [Ocfs2-devel] [patch 02/11] ocfs2: free allocated clusters if error occurs after ocfs2_claim_clusters

2014-01-27 Thread Joseph Qi
On 2014/1/28 7:07, Andrew Morton wrote: On Sun, 26 Jan 2014 10:53:24 +0800 Joseph Qi joseph...@huawei.com wrote: Hi On 2014/1/25 4:47, a...@linux-foundation.org wrote: From: Zongxun Wang wangzong...@huawei.com Subject: ocfs2: free allocated clusters if error occurs after

[Ocfs2-devel] [RFD] ocfs2: poor performance on append write/punch hole

2014-01-28 Thread Joseph Qi
In ocfs2_file_aio_write, it will fall back to buffered IO when cannot complete direct IO request, e.g. append write and punch hole. And mostly it should firstly do space allocation and this will make much more journal to flush. From test, we found the above two cases performs almost 70% lower than

[Ocfs2-devel] [PATCH] ocfs2: fix null pointer dereference when access dlm_state before launching dlm thread

2014-02-11 Thread Joseph Qi
dlm_state_print - dlm_launch_thread Move dlm_debug_init after dlm_launch_thread and dlm_launch_recovery_thread can fix this issue. Signed-off-by: Zongxun Wang wangzong...@huawei.com Signed-off-by: Joseph Qi joseph...@huawei.com --- fs/ocfs2/dlm/dlmdomain.c | 6 +++--- 1 file changed, 3 insertions

[Ocfs2-devel] [PATCH] ocfs2: remove unused variable uuid_net_key in ocfs2_initialize_super

2014-02-13 Thread Joseph Qi
From: joyce.xue xuejiu...@huawei.com Variable uuid_net_key in ocfs2_initialize_super() is not used. Clean it up. Signed-off-by: joyce.xue xuejiu...@huawei.com Signed-off-by: Joseph Qi joseph...@huawei.com --- fs/ocfs2/super.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/fs/ocfs2

[Ocfs2-devel] [PATCH] ocfs2 : fix type conversion risk when get cluster attributes

2014-03-19 Thread Joseph Qi
In o2nm_cluster, cl_idle_timeout_ms, cl_keepalive_delay_ms, as well as cl_reconnect_delay_ms, are defined as type of unsigned int. So we should also use unsigned int in the helper functions. Signed-off-by: Joseph Qi joseph...@huawei.com --- fs/ocfs2/cluster/tcp.c | 6 +++--- 1 file changed, 3

[Ocfs2-devel] [PATCH] ocfs2: fix dead lock risk when kmalloc failed in dlm_query_region_handler

2014-03-19 Thread Joseph Qi
From: Zhonghua Guo guozhong...@h3c.com In dlm_query_region_handler(), once kmalloc failed, it will unlock dlm_domain_lock without lock first, then dead lock happens. This patch adds a flag domain_locked to fix this issue. Signed-off-by: Zhonghua Guo guozhong...@h3c.com Signed-off-by: Joseph Qi

[Ocfs2-devel] [PATCH v2] ocfs2: fix dead lock risk when kmalloc failed in dlm_query_region_handler

2014-03-21 Thread Joseph Qi
From: Zhonghua Guo guozhong...@h3c.com In dlm_query_region_handler(), once kmalloc failed, it will unlock dlm_domain_lock without lock first, then dead lock happens. Signed-off-by: Zhonghua Guo guozhong...@h3c.com Signed-off-by: Joseph Qi joseph...@huawei.com Reviewed-by: Srinivas Eeda

[Ocfs2-devel] [PATCH] ocfs2: retry once dlm_dispatch_assert_master failed with ENOMEM

2014-04-03 Thread Joseph Qi
Once dlm_dispatch_assert_master failed in dlm_master_requery_handler, the only reason is ENOMEM. So just retry it instead of BUG(). Signed-off-by: Joseph Qi joseph...@huawei.com --- fs/ocfs2/dlm/dlmrecovery.c | 11 --- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/fs

Re: [Ocfs2-devel] [PATCH] ocfs2: retry once dlm_dispatch_assert_master failed with ENOMEM

2014-04-03 Thread Joseph Qi
failed to get memory, return an error to peer and peer decides to retry or give up. thanks, wengang 于 2014年04月03日 20:45, Joseph Qi 写道: Once dlm_dispatch_assert_master failed in dlm_master_requery_handler, the only reason is ENOMEM. So just retry it instead of BUG(). Signed-off-by: Joseph

[Ocfs2-devel] [PATCH v2] ocfs2: retry once dlm_dispatch_assert_master failed with ENOMEM

2014-04-08 Thread Joseph Qi
Once dlm_dispatch_assert_master failed in dlm_master_requery_handler, the only reason is ENOMEM. Add retry logic to avoid BUG() in case of not enough memory temporarily. Signed-off-by: Joseph Qi joseph...@huawei.com --- fs/ocfs2/dlm/dlmrecovery.c | 25 - 1 file changed

[Ocfs2-devel] [PATCH] ocfs2: limit printk when journal is aborted

2014-04-17 Thread Joseph Qi
Once JBD2_ABORT is set, ocfs2_commit_cache will fail in ocfs2_commit_thread. Then it will get into a loop with mass logs. This will meaninglessly consume a larger number of resource and may lead to system hung at last. So limit printk in this case. Signed-off-by: Joseph Qi joseph...@huawei.com

Re: [Ocfs2-devel] Is it an issue, or had been fixed in new kernel verions? Thanks

2014-04-17 Thread Joseph Qi
On 2014/4/15 9:22, Guozhonghua wrote: Hi, everyone: As the disk is umounted, the host is panic or bloked. The host must be repowered. The test scenario is with Linux kernel 3.13.6. Could you please describe the scenario more clearly? How many nodes in your cluster, and, are you

Re: [Ocfs2-devel] [PATCH] ocfs2: limit printk when journal is aborted

2014-04-17 Thread Joseph Qi
On 2014/4/18 5:01, Mark Fasheh wrote: On Thu, Apr 17, 2014 at 07:08:42PM +0800, Joseph Qi wrote: Once JBD2_ABORT is set, ocfs2_commit_cache will fail in ocfs2_commit_thread. Then it will get into a loop with mass logs. This will meaninglessly consume a larger number of resource and may lead

Re: [Ocfs2-devel] [PATCH] ocfs2: limit printk when journal is aborted

2014-04-18 Thread Joseph Qi
On 2014/4/18 10:45, Mark Fasheh wrote: On Fri, Apr 18, 2014 at 09:02:33AM +0800, Joseph Qi wrote: On 2014/4/18 5:01, Mark Fasheh wrote: On Thu, Apr 17, 2014 at 07:08:42PM +0800, Joseph Qi wrote: Once JBD2_ABORT is set, ocfs2_commit_cache will fail in ocfs2_commit_thread. Then it will get

Re: [Ocfs2-devel] [PATCH] ocfs2: limit printk when journal is aborted

2014-04-21 Thread Joseph Qi
On 2014/4/22 4:51, Mark Fasheh wrote: On Mon, Apr 21, 2014 at 12:18:24PM -0700, Andrew Morton wrote: On Fri, 18 Apr 2014 17:18:27 +0800 Joseph Qi joseph...@huawei.com wrote: + if (printk_timed_ratelimit(abort_warn_time, 60*HZ)) + mlog

[Ocfs2-devel] [PATCH] ocfs2: fix double kmem_cache_destroy in dlm_init

2014-05-14 Thread Joseph Qi
In dlm_init, if create dlm_lockname_cache failed in dlm_init_master_caches, it will destroy dlm_lockres_cache which created before twice. And this will cause system die when loading modules. Signed-off-by: Joseph Qi joseph...@huawei.com --- fs/ocfs2/dlm/dlmmaster.c | 8 ++-- 1 file changed

Re: [Ocfs2-devel] [PATCH 0/3] ocfs2: o2net: fix packets lost issue when reconnect

2014-05-15 Thread Joseph Qi
On 2014/5/15 12:26, Junxiao Bi wrote: Hi, After the tcp connection is established between two ocfs2 nodes, an idle timer will be set to check its state periodically, if no messages are received during this time, idle timer will timeout, it will shutdown the connection and try to rebuild,

Re: [Ocfs2-devel] [PATCH 0/3] ocfs2: o2net: fix packets lost issue when reconnect

2014-05-16 Thread Joseph Qi
Hi Junxiao, On 2014/5/16 10:19, Junxiao Bi wrote: Hi Joseph, On 05/15/2014 04:27 PM, Joseph Qi wrote: On 2014/5/15 12:26, Junxiao Bi wrote: Hi, After the tcp connection is established between two ocfs2 nodes, an idle timer will be set to check its state periodically, if no messages

Re: [Ocfs2-devel] [PATCH 0/3] ocfs2: o2net: fix packets lost issue when reconnect

2014-05-16 Thread Joseph Qi
On 2014/5/16 16:32, Junxiao Bi wrote: On 05/16/2014 04:05 PM, Joseph Qi wrote: Hi Junxiao, On 2014/5/16 10:19, Junxiao Bi wrote: Hi Joseph, On 05/15/2014 04:27 PM, Joseph Qi wrote: On 2014/5/15 12:26, Junxiao Bi wrote: Hi, After the tcp connection is established between two ocfs2 nodes

[Ocfs2-devel] [PATCH] ocfs2: fix incorrect i_size of global bitmap inode after resize

2014-05-23 Thread Joseph Qi
-off-by: Joseph Qi joseph...@huawei.com --- fs/ocfs2/resize.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/ocfs2/resize.c b/fs/ocfs2/resize.c index 822ebc1..4261c74 100644 --- a/fs/ocfs2/resize.c +++ b/fs/ocfs2/resize.c @@ -157,7 +157,7 @@ static int

[Ocfs2-devel] [PATCH] ocfs2: cleanup unused paramters in ocfs2_calc_new_backup_super

2014-05-23 Thread Joseph Qi
Parameters new_clusters and first_new_cluster are not used in ocfs2_update_last_group_and_inode, so remove them. Signed-off-by: Joseph Qi joseph...@huawei.com Reviewed-by: joyce.xue xuejiu...@huawei.com --- fs/ocfs2/resize.c | 6 -- 1 file changed, 6 deletions(-) diff --git a/fs/ocfs2

[Ocfs2-devel] [PATCH] ocfs2: correctly check the return value of ocfs2_search_extent_list

2014-06-10 Thread Joseph Qi
or larger than le16_to_cpu(el-l_next_free_rec) is meaningless. Signed-off-by: Yingtai Xie xieying...@huawei.com Signed-off-by: Joseph Qi joseph...@huawei.com --- fs/ocfs2/alloc.c| 15 --- fs/ocfs2/move_extents.c | 2 +- fs/ocfs2/refcounttree.c | 2 +- 3 files changed, 14

[Ocfs2-devel] [PATCH] ocfs2/dlm: fix race between dispatched_work and dlm_lockres_grab_inflight_worker

2014-06-27 Thread Joseph Qi
to be increased first. Signed-off-by: Joseph Qi joseph...@huawei.com Signed-off-by: Xue jiufei xuejiu...@huawei.com --- fs/ocfs2/dlm/dlmmaster.c | 12 +++- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/fs/ocfs2/dlm/dlmmaster.c b/fs/ocfs2/dlm/dlmmaster.c index 6222b35..fc78237

Re: [Ocfs2-devel] [PATCH 1/1] deadlock when two nodes are converting same lock from PR to EX and idletimeout closes conn

2014-07-22 Thread Joseph Qi
On 2014/5/21 5:53, Tariq Saeed wrote: Orabug: 18639535 Two node cluster and both nodes hold a lock at PR level and both want to convert to EX at the same time. Master node 1 has sent BAST and then closes the connection due to idletime out. Node 0 receives BAST, sends unlock req with cancel

Re: [Ocfs2-devel] Cluster blocked, so as to reboot all nodes to avoid it. Is there any patchs for it? Thanks.

2014-08-20 Thread Joseph Qi
From the stack, it seems that it blocks on loading journal during mount. Has it already been owned by another node? Try debugfs.ocfs2 'fs_locks -B' and 'dlm_locks xxx' to find out why. On 2014/8/21 9:07, Guozhonghua wrote: Hi, everyone And we have the blocked cluster several times, and

Re: [Ocfs2-devel] A deadlock when system do not has sufficient memory

2014-08-24 Thread Joseph Qi
On 2014/8/25 13:00, Sunil Mushran wrote: Functions in dlmdomain.c are only triggered during mount. So they cannot trigger the deadlock as described above in this thread. I would leave them as is. It is possible if mounts multiple volumes on each node. On Aug 24, 2014 7:06 PM, Xue jiufei

[Ocfs2-devel] [PATCH] ocfs2: fix deadlock between o2hb thread and o2net_wq

2014-08-27 Thread Joseph Qi
, o2hb_live_lock is enough to protect live node map. Signed-off-by: Joseph Qi joseph...@huawei.com --- fs/ocfs2/cluster/heartbeat.c | 19 +++ fs/ocfs2/cluster/heartbeat.h | 1 + fs/ocfs2/dlm/dlmdomain.c | 2 +- 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/fs/ocfs2

Re: [Ocfs2-devel] Can one single file's size is larger than 2T in one ocfs2 cluseter?

2014-08-28 Thread Joseph Qi
On 2014/8/28 17:49, Guozhonghua wrote: Hi all, As we have test the OCFS2, and create one image file to be used as one virtual machine’s disk, it size is more than 2T, but its stats information is error. Is file size limited to 2T? Or any other way to avoid its? AFAIK, no such limit.

Re: [Ocfs2-devel] Bug report and patch request reviews, thanks

2014-09-01 Thread Joseph Qi
On 2014/9/1 15:14, Guozhonghua wrote: Hi¸ we test one file which is larger than 2T, then we get the information wrong. Without patch, the result is as below, OCFS2, and you can see that size of the file and the blocks is not well: # ls -al /vms/ocfs2lv/test_base_0

[Ocfs2-devel] [PATCH] ocfs2/dlm: refactor error handling in dlm_alloc_ctxt

2014-09-05 Thread Joseph Qi
Refactoring error handling in dlm_alloc_ctxt to simplify code. Signed-off-by: Joseph Qi joseph...@huawei.com Reviewed-by: Alex Chen alex.c...@huawei.com --- fs/ocfs2/dlm/dlmdomain.c | 42 ++ 1 file changed, 22 insertions(+), 20 deletions(-) diff --git

[Ocfs2-devel] [PATCH] ocfs2: call o2quo_exit if malloc failed in o2net_init

2014-09-11 Thread Joseph Qi
In o2net_init, if malloc failed, it directly returns -ENOMEM. Then o2quo_exit won't be called in init_o2nm. Signed-off-by: Joseph Qi joseph...@huawei.com Reviewed-by: joyce.xue xuejiu...@huawei.com --- fs/ocfs2/cluster/tcp.c | 18 +++--- 1 file changed, 11 insertions(+), 7 deletions

[Ocfs2-devel] [PATCH] ocfs2/dlm: do not get resource spinlock if lockres is new

2014-09-15 Thread Joseph Qi
: Clean up refmap helpers). Since lockres is new, it doesn't not require the res-spinlock. So remove it. Signed-off-by: Joseph Qi joseph...@huawei.com Reviewed-by: joyce.xue xuejiu...@huawei.com --- fs/ocfs2/dlm/dlmmaster.c | 18 ++ 1 file changed, 10 insertions(+), 8 deletions(-) diff

Re: [Ocfs2-devel] [PATCH 0/7] ocfs2: allocate blocks in direct I/O write

2014-09-16 Thread Joseph Qi
Hi Andrew, Currently in case of O_DIRECT append write (block not allocated yet), ocfs2 will fall back to buffered I/O. This has some disadvantages. Firstly, it is not the behavior as expected. Secondly, it will consume huge page cache, e.g. in mass backup scenario. Thirdly, modern filesystems such

Re: [Ocfs2-devel] One node hangs up issue requiring goog idea, thanks

2014-09-30 Thread Joseph Qi
I don't think this is right. There are two scenario when returns -ENOTCONN or -EHOSTDOWN: 1) Connection down when sending the message; 2) Connection down when responding the messages; So just resend the message may lead to remote handles twice. On 2014/9/26 20:06, Guozhonghua wrote: Hi, all,

Re: [Ocfs2-devel] [PATCH] ocfs2/dlm: call dlm_lockres_put without resource spinlock

2014-10-07 Thread Joseph Qi
-dlm_print_one_lock_resource -spin_lock(res-spinlock) Signed-off-by: Alex Chen alex.c...@huawei.com Reviewed-by: Joseph Qi joseph...@huawei.com --- fs/ocfs2/dlm/dlmrecovery.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/fs/ocfs2/dlm/dlmrecovery.c b/fs/ocfs2/dlm

[Ocfs2-devel] [PATCH] ocfs2/dlm: let sender retry if dlm_dispatch_assert_master failed with -ENOMEM

2014-10-08 Thread Joseph Qi
Do not BUG() if GFP_ATOMIC allocation fails in dlm_dispatch_assert_master. Instead, return -ENOMEM to the sender and then retry. Signed-off-by: Joseph Qi joseph...@huawei.com Reviewed-by: Alex Chen alex.c...@huawei.com --- fs/ocfs2/dlm/dlmrecovery.c | 18 +- 1 file changed, 13

Re: [Ocfs2-devel] Ocfs2-devel Digest, Vol 127, Issue 25

2014-10-09 Thread Joseph Qi
On 2014/10/9 15:16, Guozhonghua wrote: Hi Joseph and Srinivas, We had merged and test the two patches: 1.ocfs2: o2net: set tcp user timeout to max value 8e9801dfe37c9e68cdbfcd15988df2187191864e 2.ocfs2: o2net: don't shutdown connection when idle timeout

Re: [Ocfs2-devel] [PATCH 4/7 v4] ocfs2: add and remove inode in orphan dir in ocfs2_direct_IO

2014-10-22 Thread Joseph Qi
, and then delete it once append O_DIRECT finished. This is to make sure block allocation and inode size are consistent. Signed-off-by: Weiwei Wang wangww...@huawei.com Reviewed-by: Joseph Qi joseph...@huawei.com --- fs/ocfs2/aops.c | 178 ++-- 1

Re: [Ocfs2-devel] [PATCH 2/7 v4] ocfs2: add two functions of add and remove inode in orphan dir

2014-10-22 Thread Joseph Qi
. Here the original functions ocfs2_orphan_add and ocfs2_orphan_del are called respectively. Signed-off-by: Weiwei Wang wangww...@huawei.com Reviewed-by: Joseph Qi joseph...@huawei.com --- fs/ocfs2/journal.h | 5 ++ fs/ocfs2/namei.c | 147

Re: [Ocfs2-devel] [PATCH 7/7 v4] ocfs2: do not fallback to buffer I/O write if fill holes

2014-10-22 Thread Joseph Qi
On 2014/10/11 20:32, WeiWei Wang wrote: Now append O_DIRECT write to a hole will try direct io first, then fallback to buffered IO if fails. Signed-off-by: Weiwei Wang wangww...@huawei.com Reviewed-by: Joseph Qi joseph...@huawei.com --- fs/ocfs2/file.c | 93

[Ocfs2-devel] [PATCH 1/7 v5] ocfs2: eliminate the static flag of some functions

2014-10-28 Thread Joseph Qi
From: Weiwei Wang wangww...@huawei.com Eliminate the static flag of some functions which will be used in append O_DIRECT write. Signed-off-by: Weiwei Wang wangww...@huawei.com Signed-off-by: Joseph Qi joseph...@huawei.com --- fs/ocfs2/file.c | 11 +-- fs/ocfs2/file.h | 9 + 2

[Ocfs2-devel] [PATCH 2/7 v5] ocfs2: add functions to add and remove inode in orphan dir

2014-10-28 Thread Joseph Qi
for the same inode. Signed-off-by: Weiwei Wang wangww...@huawei.com Signed-off-by: Joseph Qi joseph...@huawei.com --- fs/ocfs2/journal.h | 5 + fs/ocfs2/namei.c | 315 + fs/ocfs2/namei.h | 5 + fs/ocfs2/ocfs2_fs.h| 5 +- fs/ocfs2

[Ocfs2-devel] [PATCH 4/7 v5] ocfs2: implement ocfs2_direct_IO_write

2014-10-28 Thread Joseph Qi
-off-by: Joseph Qi joseph...@huawei.com --- fs/ocfs2/aops.c | 191 +++- 1 file changed, 188 insertions(+), 3 deletions(-) diff --git a/fs/ocfs2/aops.c b/fs/ocfs2/aops.c index 1ef547e..eb41ede 100644 --- a/fs/ocfs2/aops.c +++ b/fs/ocfs2/aops.c

[Ocfs2-devel] [PATCH 5/7 v5] ocfs2: allocate blocks in ocfs2_direct_IO_get_blocks

2014-10-28 Thread Joseph Qi
From: Weiwei Wang wangww...@huawei.com Allow blocks allocation in ocfs2_direct_IO_get_blocks. Signed-off-by: Weiwei Wang wangww...@huawei.com Signed-off-by: Joseph Qi joseph...@huawei.com --- fs/ocfs2/aops.c | 45 ++--- 1 file changed, 42 insertions(+), 3

[Ocfs2-devel] [PATCH 6/7 v5] ocfs2: do not fallback to buffer I/O write if appending

2014-10-28 Thread Joseph Qi
From: Weiwei Wang wangww...@huawei.com Now we can do direct io and do not fallback to buffered IO any more in case of append O_DIRECT write. Signed-off-by: Weiwei Wang wangww...@huawei.com Signed-off-by: Joseph Qi joseph...@huawei.com --- fs/ocfs2/file.c | 5 - 1 file changed, 4 insertions

[Ocfs2-devel] [PATCH 7/7 v5] ocfs2: do not fallback to buffer I/O write if fill holes

2014-10-28 Thread Joseph Qi
From: Weiwei Wang wangww...@huawei.com Now append O_DIRECT write to a hole will try direct io first, then fallback to buffered IO if fails. Signed-off-by: Weiwei Wang wangww...@huawei.com Signed-off-by: Joseph Qi joseph...@huawei.com --- fs/ocfs2/file.c | 92

Re: [Ocfs2-devel] [PATCH 1/1] o2dlm: fix a race between purge and master query

2014-10-29 Thread Joseph Qi
We tested this patch and it works well. Thanks. Tested-by: Joseph Qi joseph...@huawei.com On 2014/10/29 6:24, Srinivas Eeda wrote: Node A sends master query request to node B which is the master. At this time lockres happens to be on purgelist. dlm_master_request_handler gets the dlm spinlock

[Ocfs2-devel] [PATCH] ocfs2: fix leftover orphan entry caused by append O_DIRECT write crash

2014-10-31 Thread Joseph Qi
. If this case happens, we let it wait for orphan recovery first. Signed-off-by: Joseph Qi joseph...@huawei.com --- fs/ocfs2/inode.h | 2 ++ fs/ocfs2/journal.c | 2 ++ fs/ocfs2/namei.c | 37 +++-- fs/ocfs2/super.c | 2 ++ 4 files changed, 41 insertions(+), 2

Re: [Ocfs2-devel] [PATCH] ocfs2: improve code readability

2014-11-02 Thread Joseph Qi
You are right. Actually Andrew has already fixed this in mm tree. Thanks. On 2014/10/31 20:29, Sudip Mukherjee wrote: code was getting confusing as the priority of both the operators ! and are same. this change is done to just to improve the readability of the code. Signed-off-by: Sudip

Re: [Ocfs2-devel] [PATCH] ocfs2: Remove pointless assignment in ocfs2_init()

2014-11-05 Thread Joseph Qi
Does it mean we can ignore the failure of creating debugfs? On 2014/10/21 23:02, Jan Kara wrote: Remove assignment which is never used. Coverity-id: 1227009 Signed-off-by: Jan Kara j...@suse.cz --- fs/ocfs2/super.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git

Re: [Ocfs2-devel] [PATCH] ocfs2: Fix error handling when creating debugfs root in ocfs2_init()

2014-11-05 Thread Joseph Qi
Looks good to me. Thanks. Reviewed-by: Joseph Qi joseph...@huawei.com On 2014/11/6 15:07, Jan Kara wrote: Error handling if creation of root of debugfs in ocfs2_init() fails is broken. Although error code is set we fail to exit ocfs2_init() with error and thus initialization ends with success

[Ocfs2-devel] [PATCH] ocfs2: fix brelse warning if ocfs2_direct_IO_get_blocks failed

2014-12-02 Thread Joseph Qi
...@huawei.com Signed-off-by: Joseph Qi joseph...@huawei.com Reviewed-by: joyce.xue xuejiu...@huawei.com --- fs/ocfs2/aops.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/ocfs2/aops.c b/fs/ocfs2/aops.c index 38e5a9f..cf4be6a 100644 --- a/fs/ocfs2/aops.c +++ b/fs/ocfs2/aops.c @@ -731,6 +731,7

[Ocfs2-devel] [PATCH] ocfs2: remove bogus check in dlm_process_recovery_data

2014-12-16 Thread Joseph Qi
In dlm_process_recovery_data, only when dlm_new_lock failed the ret will be set to -ENOMEM. And in this case, newlock is definitely NULL. So test newlock is meaningless, remove it. Signed-off-by: Joseph Qi joseph...@huawei.com Reviewed-by: Alex Chen alex.c...@huawei.com --- fs/ocfs2/dlm

Re: [Ocfs2-devel] [patch 09/15] ocfs2: add functions to add and remove inode in orphan dir

2014-12-18 Thread Joseph Qi
Hi Mark, I much appreciate your pertinent comments on this feature. The reason we use orphan dir is to make sure allocating blocks and updating inode size consistent, and this will result an entry in orphan is not truly deleted one. To distinguish dio from unlink, we introduce a new dinode flag

Re: [Ocfs2-devel] [patch 09/15] ocfs2: add functions to add and remove inode in orphan dir

2014-12-21 Thread Joseph Qi
On 2014/12/20 4:33, Mark Fasheh wrote: On Fri, Dec 19, 2014 at 11:37:56AM +0800, Joseph Qi wrote: Hi Mark, I much appreciate your pertinent comments on this feature. The reason we use orphan dir is to make sure allocating blocks and updating inode size consistent, and this will result

Re: [Ocfs2-devel] ocfs2 patch review for 3.19

2015-02-04 Thread Joseph Qi
Hi Andrew, On 2015/2/5 8:00, Andrew Morton wrote: Thsi time I have only four patches which I consider need expert review, please. ocfs2-prune-the-dcache-before-deleting-the-dentry-of-directory.patch o2dlm-fix-null-pointer-dereference-in-o2dlm_blocking_ast_wrapper.patch (Joseph Qi had

[Ocfs2-devel] [PATCH 3/9 v6] ocfs2: add orphan recovery types in ocfs2_recover_orphans

2015-01-20 Thread Joseph Qi
Define two orphan recovery types, which indicates if need truncate file or not. Signed-off-by: Joseph Qi joseph...@huawei.com Cc: Weiwei Wang wangww...@huawei.com --- fs/ocfs2/journal.c | 108 +++-- fs/ocfs2/ocfs2.h | 5 +++ 2 files changed, 93

[Ocfs2-devel] [PATCH 5/9 v6] ocfs2: allocate blocks in ocfs2_direct_IO_get_blocks

2015-01-20 Thread Joseph Qi
Allow blocks allocation in ocfs2_direct_IO_get_blocks. Signed-off-by: Joseph Qi joseph...@huawei.com Cc: Weiwei Wang wangww...@huawei.com --- fs/ocfs2/aops.c | 45 ++--- 1 file changed, 42 insertions(+), 3 deletions(-) diff --git a/fs/ocfs2/aops.c b/fs

[Ocfs2-devel] [PATCH 4/9 v6] ocfs2: implement ocfs2_direct_IO_write

2015-01-20 Thread Joseph Qi
Implement ocfs2_direct_IO_write. Add the inode to orphan dir first, and then delete it once append O_DIRECT finished. This is to make sure block allocation and inode size are consistent. Signed-off-by: Joseph Qi joseph...@huawei.com Cc: Weiwei Wang wangww...@huawei.com --- fs/ocfs2/aops.c

[Ocfs2-devel] [PATCH 8/9 v6] ocfs2: wait for orphan recovery first once append O_DIRECT write crash

2015-01-20 Thread Joseph Qi
...@huawei.com Signed-off-by: Joseph Qi joseph...@huawei.com --- fs/ocfs2/inode.h | 2 ++ fs/ocfs2/journal.c | 2 ++ fs/ocfs2/namei.c | 37 + fs/ocfs2/super.c | 2 ++ 4 files changed, 43 insertions(+) diff --git a/fs/ocfs2/inode.h b/fs/ocfs2/inode.h index ca3431e

[Ocfs2-devel] [PATCH 2/9 v6] ocfs2: add functions to add and remove inode in orphan dir

2015-01-20 Thread Joseph Qi
Add functions to add inode to orphan dir and remove inode in orphan dir. Here we do not call ocfs2_prepare_orphan_dir and ocfs2_orphan_add directly. Because append O_DIRECT will add inode to orphan two and may result in more than one orphan entry for the same inode. Signed-off-by: Joseph Qi

[Ocfs2-devel] [PATCH 1/9 v6] ocfs2: prepare some interfaces used in append direct io

2015-01-20 Thread Joseph Qi
Prepare some interfaces which will be used in append O_DIRECT write. Signed-off-by: Joseph Qi joseph...@huawei.com Cc: Weiwei Wang wangww...@huawei.com --- fs/ocfs2/file.c | 11 +-- fs/ocfs2/file.h | 9 + 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/fs/ocfs2

[Ocfs2-devel] [PATCH 9/9 v6] ocfs2: set append dio as a ro compat feature

2015-01-20 Thread Joseph Qi
Intruduce a bit OCFS2_FEATURE_RO_COMPAT_APPEND_DIO and check it in write flow. If the bit is not set, fall back to the old way. Signed-off-by: Joseph Qi joseph...@huawei.com Cc: Weiwei Wang wangww...@huawei.com --- fs/ocfs2/file.c | 17 - fs/ocfs2/ocfs2.h| 8 fs

[Ocfs2-devel] [PATCH 0/9 v6] ocfs2: support append O_DIRECT write

2015-01-20 Thread Joseph Qi
Currently in case of append O_DIRECT write (block not allocated yet), ocfs2 will fall back to buffered I/O. This has some disadvantages. Firstly, it is not the behavior as expected. Secondly, it will consume huge page cache, e.g. in mass backup scenario. Thirdly, modern filesystems such as ext4

Re: [Ocfs2-devel] [PATCH 0/9 v6] ocfs2: support append O_DIRECT write

2015-01-20 Thread Joseph Qi
Thanks, Junxiao. On 01/20/2015 04:01 PM, Joseph Qi wrote: Currently in case of append O_DIRECT write (block not allocated yet), ocfs2 will fall back to buffered I/O. This has some disadvantages. Firstly, it is not the behavior as expected. Secondly, it will consume huge page cache, e.g

  1   2   3   4   5   >