[PATCH V2] perf/x86/intel/uncore: allocate pmu index for pci device dynamically

2018-05-19 Thread Eric Ren
core_imc_3 Signed-off-by: Shanpei Chen Signed-off-by: Eric Ren Reviewed-by: Kan Liang --- Changes since v1: 1. As Kan Liang suggested, use the same coding style as the existing code, also better readability. --- arch/x86/events/intel/uncore.c | 9 - arch/x86/events/intel/uncore.h

[PATCH] perf/x86/intel/uncore: allocate pmu index for pci device dynamically

2018-05-17 Thread Eric Ren
core_imc_3 Signed-off-by: Shanpei Chen Signed-off-by: Eric Ren --- arch/x86/events/intel/uncore.c | 7 ++- arch/x86/events/intel/uncore.h | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/arch/x86/events/intel/uncore.c b/arch/x86/events/intel/uncore.c index a7956fc..88d3

Re: [Ocfs2-devel] [PATCH] ocfs2: try a blocking lock before return AOP_TRUNCATED_PAGE

2017-12-27 Thread Eric Ren
Hi, On 12/27/2017 05:29 PM, Gang He wrote: If we can't get inode lock immediately in the function ocfs2_inode_lock_with_page() when reading a page, we should not return directly here, since this will lead to a softlockup problem. The method is to get a blocking lock and immediately unlock befor

Re: [PATCH v2] ocfs2: fix deadlock caused by recursive locking in xattr

2017-06-22 Thread Eric Ren
xes this one by using ocfs2_inode_{lock|unlock}_tracker, which is exported by commit 439a36b8ef38 ("ocfs2/dlmglue: prepare tracking logic to avoid recursive cluster lock"). Changes since v1: - Revised git commit description style in commit log. Reported-by: Thomas Voegtle Tested-by: Thoma

[PATCH v2] ocfs2: fix deadlock caused by recursive locking in xattr

2017-06-21 Thread Eric Ren
unlock}_tracker, which is exported by commit 439a36b8ef38 ("ocfs2/dlmglue: prepare tracking logic to avoid recursive cluster lock"). Changes since v1: - Revised git commit description style in commit log. Reported-by: Thomas Voegtle Tested-by: Thomas Voegtle Signed-off-by: Eric Ren --

Re: [Ocfs2-devel] [PATCH] ocfs2: get rid of ocfs2_is_o2cb_active function

2017-06-21 Thread Eric Ren
not total safe, base on the design of stackglue, we need to get ocfs2_stack_lock lock before using ocfs2_stack related data structures, and that active_stack pointer can be NULL in case mount failure. Signed-off-by: Gang He Looks good. Reviewed-by: Eric Ren Eric --- fs/ocfs2/dlmglue.c | 2 +-

[PATCH] ocfs2: fix deadlock caused by recursive locking in xattr

2017-06-21 Thread Eric Ren
unlock}_tracker, which is exported by 439a36b8ef38 ("ocfs2/dlmglue: prepare tracking logic to avoid recursive cluster lock"). Reported-by:Thomas Voegtle Tested-by: Thomas Voegtle Signed-off-by: Eric Ren --- fs/ocfs2/dlmglue.c | 4 fs/ocfs2/xattr.c | 23 +

Re: [Ocfs2-devel] [PATCH v2] ocfs2: fix a static checker warning

2017-05-23 Thread Eric Ren
check"). after apply this patch, the error return value will not be NULL(zero). Signed-off-by: Gang He Looks good to me. Reviewed-by: Eric Ren --- fs/ocfs2/inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/ocfs2/inode.c b/fs/ocfs2/inode.c index 382401d..1a1

[PATCH v4 2/2] ocfs2: fix deadlock issue when taking inode lock at vfs entry points

2017-01-17 Thread Eric Ren
ses, suggested by: Junxiao Bi. Changes since v2: - Use new wrappers of tracking logic code, suggested by: Junxiao Bi. Signed-off-by: Eric Ren Reviewed-by: Junxiao Bi Reviewed-by: Joseph Qi --- fs/ocfs2/acl.c | 29 + fs/ocfs2/file.c | 58 +++

[PATCH v4 0/2] fix deadlock caused by recursive cluster locking

2017-01-17 Thread Eric Ren
suggested by: Junxiao Bi. Change since v3: - Fixes redundant space, spotted by: Joseph Qi. Your comments and feedbacks are always welcomed. Eric Ren (2): ocfs2/dlmglue: prepare tracking logic to avoid recursive cluster lock ocfs2: fix deadlock issue when taking inode lock at vfs entry points

[PATCH v4 1/2] ocfs2/dlmglue: prepare tracking logic to avoid recursive cluster lock

2017-01-17 Thread Eric Ren
sted by: Junxiao Bi. Change since v3: - Fixes redundant space, spotted by: Joseph Qi. [s...@canb.auug.org.au remove some inlines] Signed-off-by: Eric Ren Reviewed-by: Junxiao Bi Reviewed-by: Joseph Qi --- fs/ocfs2/dlmglue.c | 105 +++-- fs/ocf

Re: [PATCH v3 1/2] ocfs2/dlmglue: prepare tracking logic to avoid recursive cluster lock

2017-01-17 Thread Eric Ren
Hi! On 01/17/2017 04:43 PM, Joseph Qi wrote: On 17/1/17 15:55, Eric Ren wrote: Hi! On 01/17/2017 03:39 PM, Joseph Qi wrote: On 17/1/17 14:30, Eric Ren wrote: We are in the situation that we have to avoid recursive cluster locking, but there is no way to check if a cluster lock has been

Re: [PATCH v3 1/2] ocfs2/dlmglue: prepare tracking logic to avoid recursive cluster lock

2017-01-16 Thread Eric Ren
Hi! On 01/17/2017 03:39 PM, Joseph Qi wrote: On 17/1/17 14:30, Eric Ren wrote: We are in the situation that we have to avoid recursive cluster locking, but there is no way to check if a cluster lock has been taken by a precess already. Mostly, we can avoid recursive locking by writing code

[PATCH v3 2/2] ocfs2: fix deadlock issue when taking inode lock at vfs entry points

2017-01-16 Thread Eric Ren
ses, suggested by: Junxiao Bi. Changes since v2: - Use new wrappers of tracking logic code, suggested by: Junxiao Bi. Signed-off-by: Eric Ren --- fs/ocfs2/acl.c | 29 + fs/ocfs2/file.c | 58 - 2 files changed, 5

[PATCH v3 1/2] ocfs2/dlmglue: prepare tracking logic to avoid recursive cluster lock

2017-01-16 Thread Eric Ren
gested by: Junxiao Bi. [s...@canb.auug.org.au remove some inlines] Signed-off-by: Eric Ren --- fs/ocfs2/dlmglue.c | 105 +++-- fs/ocfs2/dlmglue.h | 18 + fs/ocfs2/ocfs2.h | 1 + 3 files changed, 121 insertions(+), 3 deletions(-) diff -

[PATCH v3 0/2] fix deadlock caused by recursive cluster locking

2017-01-16 Thread Eric Ren
. - Do not inline functions whose bodies are not in scope, changed by: Stephen Rothwell . Changes since v2: - Use new wrappers of tracking logic code, suggested by: Junxiao Bi. Your comments and feedbacks are always welcomed. Eric Ren (2): ocfs2/dlmglue: prepare tracking logic to avoid recursive

Re: [PATCH v2 2/2] ocfs2: fix deadlock issue when taking inode lock at vfs entry points

2017-01-15 Thread Eric Ren
Hi! On 01/16/2017 02:58 PM, Junxiao Bi wrote: On 01/16/2017 02:42 PM, Eric Ren wrote: Commit 743b5f1434f5 ("ocfs2: take inode lock in ocfs2_iop_set/get_acl()") results in a deadlock, as the author "Tariq Saeed" realized shortly after the patch was merged. The discussion

[PATCH v2 0/2] fix deadlock caused by recursive cluster locking

2017-01-15 Thread Eric Ren
. 4. Do not inline functions whose bodies are not in scope, changed by: Stephen Rothwell . Your comments and feedbacks are always welcomed. Eric Ren (2): ocfs2/dlmglue: prepare tracking logic to avoid recursive cluster lock ocfs2: fix deadlock issue when taking inode lock at vfs entry poi

[PATCH v2 1/2] ocfs2/dlmglue: prepare tracking logic to avoid recursive cluster lock

2017-01-15 Thread Eric Ren
me "ocfs2_lock_holder", suggested by: Junxiao Bi . 3. Do not inline functions whose bodies are not in scope, changed by: Stephen Rothwell . [s...@canb.auug.org.au remove some inlines] Signed-off-by: Eric Ren --- fs/ocfs2/dlmglue.c | 48 +---

[PATCH v2 2/2] ocfs2: fix deadlock issue when taking inode lock at vfs entry points

2017-01-15 Thread Eric Ren
ate if the process gets the cluster lock - suggested by: Joseph Qi and Junxiao Bi . 2. Change "struct ocfs2_holder" to a more meaningful name "ocfs2_lock_holder", suggested by: Junxiao Bi . 3. Add debugging output at ocfs2_setattr() and ocfs2_permission() to catch exceptional

Re: [PATCH 1/2] ocfs2/dlmglue: prepare tracking logic to avoid recursive cluster lock

2017-01-15 Thread Eric Ren
Hi Junxiao, OK, good suggestion. Hrm, but in order to align with "ocfs2_inc_holders", I think it's good to keep those function names as it is;-) that name is also not very clear. Maybe you can make another patch to clear it. Maybe, the name completeness needs to compromise with the name length

Re: [PATCH 2/2] ocfs2: fix deadlocks when taking inode lock at vfs entry points

2017-01-15 Thread Eric Ren
On 01/16/2017 11:13 AM, Junxiao Bi wrote: On 01/16/2017 11:06 AM, Eric Ren wrote: Hi Junxiao, On 01/16/2017 10:46 AM, Junxiao Bi wrote: If had_lock==true, it is a bug? I think we should BUG_ON for it, that can help us catch bug at the first time. Good idea! But I'm not sure if "ocf

Re: [PATCH 2/2] ocfs2: fix deadlocks when taking inode lock at vfs entry points

2017-01-15 Thread Eric Ren
Hi Junxiao, On 01/16/2017 10:46 AM, Junxiao Bi wrote: If had_lock==true, it is a bug? I think we should BUG_ON for it, that can help us catch bug at the first time. Good idea! But I'm not sure if "ocfs2_setattr" is always the first one who takes the cluster lock. It's harder for me to name all

Re: [Ocfs2-devel] [PATCH v3] ocfs2/journal: fix umount hang after flushing journal failure

2017-01-13 Thread Eric Ren
On 01/13/2017 10:52 AM, Changwei Ge wrote: Hi Joseph, Do you think my last version of patch to fix umount hang after journal flushing failure is OK? If so, I 'd like to ask Andrew's help to merge this patch into his test tree. Thanks, Br. Changwei The message above should not occur in a f

Re: [PATCH 2/2] ocfs2: fix deadlocks when taking inode lock at vfs entry points

2017-01-12 Thread Eric Ren
Hi! On 01/13/2017 12:22 PM, Junxiao Bi wrote: On 01/05/2017 11:31 PM, Eric Ren wrote: Commit 743b5f1434f5 ("ocfs2: take inode lock in ocfs2_iop_set/get_acl()") results in a deadlock, as the author "Tariq Saeed" realized shortly after the patch was merged. The discussion

Re: [PATCH 1/2] ocfs2/dlmglue: prepare tracking logic to avoid recursive cluster lock

2017-01-12 Thread Eric Ren
Hi Junxiao! On 01/13/2017 11:59 AM, Junxiao Bi wrote: On 01/05/2017 11:31 PM, Eric Ren wrote: We are in the situation that we have to avoid recursive cluster locking, but there is no way to check if a cluster lock has been taken by a precess already. Mostly, we can avoid recursive locking by

Re: linux-next: build failure after merge of the akpm-current tree

2017-01-12 Thread Eric Ren
Hi, On 01/13/2017 11:42 AM, Stephen Rothwell wrote: Hi Eric, On Thu, 12 Jan 2017 13:06:01 +0800 Eric Ren wrote: Thanks for your report and the fix for it. The 0-day project has reported several days ago, but this patch set is still in discussion, so I am waiting for more days to see if

Re: [Ocfs2-devel] [PATCH 2/2] ocfs2: fix deadlocks when taking inode lock at vfs entry points

2017-01-12 Thread Eric Ren
Hi Joseph, On 01/09/2017 10:13 AM, Eric Ren wrote: So you are trying to fix it by making phase3 finish without really doing Phase3 can go ahead because this node is already under protection of cluster lock. You said it was blocked... Oh, sorry, I meant phase3 can go ahead if this patch set

Re: linux-next: build failure after merge of the akpm-current tree

2017-01-11 Thread Eric Ren
Hi Stephen, Thanks for your report and the fix for it. The 0-day project has reported several days ago, but this patch set is still in discussion, so I am waiting for more days to see if other developers have any other questions. I am confused that how to deal with your patch if I need to w

Re: [PATCH 2/2] ocfs2: fix deadlocks when taking inode lock at vfs entry points

2017-01-08 Thread Eric Ren
/0day-ci/linux/commits/Eric-Ren/fix-deadlock-caused-by-recursive-cluster-locking/20170106-200837 config: ia64-allyesconfig (attached as .config) compiler: ia64-linux-gcc (GCC) 6.2.0 reproduce: wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin

Re: [PATCH 2/2] ocfs2: fix deadlocks when taking inode lock at vfs entry points

2017-01-08 Thread Eric Ren
nce! Eric Did I answer your question? Thanks! Eric Thanks, Joseph Thanks, Eric Thanks, Joseph Thanks, Eric Thanks, Joseph Thanks for your review;-) Eric Thanks, Joseph Signed-off-by: Eric Ren --- fs/ocfs2/acl.c | 39 ++- fs/ocfs2/file.c | 4

Re: [PATCH 2/2] ocfs2: fix deadlocks when taking inode lock at vfs entry points

2017-01-06 Thread Eric Ren
Hi! On 01/06/2017 05:55 PM, Joseph Qi wrote: On 17/1/6 17:13, Eric Ren wrote: Hi, Fixes them by adding the tracking logic (in the previous patch) for these funcs above, ocfs2_permission(), ocfs2_iop_[set|get]_acl(), ocfs2_setattr(). As described cases above, shall we just add the tracking

Re: [PATCH 2/2] ocfs2: fix deadlocks when taking inode lock at vfs entry points

2017-01-06 Thread Eric Ren
. So, there is no need to unlock in such case. Thanks, Eric Thanks, Joseph Thanks, Eric Thanks, Joseph Thanks for your review;-) Eric Thanks, Joseph Signed-off-by: Eric Ren --- fs/ocfs2/acl.c | 39 ++- fs/ocfs2/file.c | 44 ++

Re: [PATCH 2/2] ocfs2: fix deadlocks when taking inode lock at vfs entry points

2017-01-06 Thread Eric Ren
On 01/06/2017 03:14 PM, Joseph Qi wrote: On 17/1/6 14:56, Eric Ren wrote: On 01/06/2017 02:09 PM, Joseph Qi wrote: Hi Eric, On 17/1/5 23:31, Eric Ren wrote: Commit 743b5f1434f5 ("ocfs2: take inode lock in ocfs2_iop_set/get_acl()") results in a deadlock, as the author &q

Re: [PATCH 1/2] ocfs2/dlmglue: prepare tracking logic to avoid recursive cluster lock

2017-01-06 Thread Eric Ren
On 01/06/2017 03:24 PM, Joseph Qi wrote: On 17/1/6 15:03, Eric Ren wrote: On 01/06/2017 02:07 PM, Joseph Qi wrote: Hi Eric, On 17/1/5 23:31, Eric Ren wrote: We are in the situation that we have to avoid recursive cluster locking, but there is no way to check if a cluster lock has been

Re: [PATCH 2/2] ocfs2: fix deadlocks when taking inode lock at vfs entry points

2017-01-05 Thread Eric Ren
On 01/06/2017 02:09 PM, Joseph Qi wrote: Hi Eric, On 17/1/5 23:31, Eric Ren wrote: Commit 743b5f1434f5 ("ocfs2: take inode lock in ocfs2_iop_set/get_acl()") results in a deadlock, as the author "Tariq Saeed" realized shortly after the patch was merged. The discussion

Re: [PATCH 1/2] ocfs2/dlmglue: prepare tracking logic to avoid recursive cluster lock

2017-01-05 Thread Eric Ren
On 01/06/2017 02:07 PM, Joseph Qi wrote: Hi Eric, On 17/1/5 23:31, Eric Ren wrote: We are in the situation that we have to avoid recursive cluster locking, but there is no way to check if a cluster lock has been taken by a precess already. Mostly, we can avoid recursive locking by writing

[PATCH 2/2] ocfs2: fix deadlocks when taking inode lock at vfs entry points

2017-01-05 Thread Eric Ren
cfs2_iop_get_acl <=== take PR ocfs2_iop_set_acl <=== take EX Fixes them by adding the tracking logic (in the previous patch) for these funcs above, ocfs2_permission(), ocfs2_iop_[set|get]_acl(), ocfs2_setattr(). Signed-off-by: Eric Ren --- fs/ocfs2/acl.c | 39 ++

[PATCH 1/2] ocfs2/dlmglue: prepare tracking logic to avoid recursive cluster lock

2017-01-05 Thread Eric Ren
permission check, (get|set)_(acl|attr), and the gfs2 code also do so. Signed-off-by: Eric Ren --- fs/ocfs2/dlmglue.c | 47 --- fs/ocfs2/dlmglue.h | 18 ++ fs/ocfs2/ocfs2.h | 1 + 3 files changed, 63 insertions(+), 3 deletions(-) diff

[PATCH 0/2] fix deadlock caused by recursive cluster locking

2017-01-05 Thread Eric Ren
messes up the dlmglue core, nor has a performance penalty on the whole cluster locking system. Instead, it is only used in places where such recursive cluster locking may happen. Your comments and feedbacks are always welcomed. Eric Ren (2): ocfs2/dlmglue: prepare tracking logic to avoid

Re: [PATCH] ocfs2: fix crash caused by stale lvb with fsdlm plugin

2016-12-14 Thread Eric Ren
ly if someone familiar with o2cb works out a patch for o2cb in the future. Does this sounds good to you? Thanks, Eric Thanks, Joseph On 16/12/9 17:30, Eric Ren wrote: The crash happens rather often when we reset some cluster nodes while nodes contend fiercely to do truncate and append. The cr

Re: [Ocfs2-devel] [PATCH] ocfs2: fix crash caused by stale lvb with fsdlm plugin

2016-12-11 Thread Eric Ren
* crash! */ The fix is quite straightforward. We keep to set DLM_LKF_VALBLK flag for dlm_lock() if the lock resource type needs LVB and the fsdlm plugin is uesed. Signed-off-by: Eric Ren --- fs/ocfs2/dlmglue.c | 10 ++ fs/ocfs2/stackglue.c | 6 ++ fs/ocfs2/stackglue.h | 3 +

Re: [PATCH] ocfs2: fix crash caused by stale lvb with fsdlm plugin

2016-12-09 Thread Eric Ren
Sorry, this email is not delivered to Mark successfully because of one weird character trailing his email address somehow. So, resend later... Thanks, Eric On 12/09/2016 05:24 PM, Eric Ren wrote: The crash happens rather often when we reset some cluster nodes while nodes contend fiercely to

[PATCH] ocfs2: fix crash caused by stale lvb with fsdlm plugin

2016-12-09 Thread Eric Ren
dlm_lock() if the lock resource type needs LVB and the fsdlm plugin is uesed. Signed-off-by: Eric Ren --- fs/ocfs2/dlmglue.c | 10 ++ fs/ocfs2/stackglue.c | 6 ++ fs/ocfs2/stackglue.h | 3 +++ 3 files changed, 19 insertions(+) diff --git a/fs/ocfs2/dlmglue.c b/fs/ocfs2/dlmglue.c ind

Re: [PATCH] jbd2: add jbd2_journal_init() helper

2016-09-03 Thread Eric Ren
Hi Geliang, On 08/31/2016 08:23 PM, Geliang Tang wrote: There are some repetitive code in jbd2_journal_init_dev() and jbd2_journal_init_inode(). So this patch extracts the common code into jbd2_journal_init() helper to simplify the code. And fix the coding style warnings reported by checkpatch.p

Re: [Ocfs2-devel] [PATCH v4 2/5] ocfs2: sysfile interfaces for online file check

2016-03-08 Thread Eric Ren
On 02/29/2016 01:17 PM, Gang He wrote: Implement online file check sysfile interfaces, e.g. how to create the related sysfile according to device name, how to display/handle file check request from the sysfile. Signed-off-by: Gang He Tested-by: Eric Ren --- fs/ocfs2/Makefile| 3

Re: [Ocfs2-devel] [PATCH v4 4/5] ocfs2: check/fix inode block for online file check

2016-03-08 Thread Eric Ren
On 02/29/2016 01:18 PM, Gang He wrote: Implement online check or fix inode block during reading a inode block to memory. Signed-off-by: Gang He Tested-by: Eric Ren --- fs/ocfs2/inode.c | 225 +++-- fs/ocfs2/ocfs2_trace.h | 2 + 2