All of lore.kernel.org
 help / color / mirror / Atom feed
* [Ocfs2-devel] [PATCH] ocfs2/dlm: clean up deadcode in dlm_master_request_handler()
@ 2016-10-31 13:52 piaojun
  2016-11-01  0:22 ` Joseph Qi
  2019-09-04  4:14 ` Andrew Morton
  0 siblings, 2 replies; 3+ messages in thread
From: piaojun @ 2016-10-31 13:52 UTC (permalink / raw)
  To: ocfs2-devel

when 'dispatch_assert' is set, 'response' must be DLM_MASTER_RESP_YES,
and 'res' won't be null, so execution can't reach these two branch.

Signed-off-by: Jun Piao <piaojun@huawei.com>
---
 fs/ocfs2/dlm/dlmmaster.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/fs/ocfs2/dlm/dlmmaster.c b/fs/ocfs2/dlm/dlmmaster.c
index 3f828a1..9a72dd8 100644
--- a/fs/ocfs2/dlm/dlmmaster.c
+++ b/fs/ocfs2/dlm/dlmmaster.c
@@ -1644,12 +1644,6 @@ int dlm_master_request_handler(struct o2net_msg *msg, u32 len, void *data,
 	 * dlm_assert_master_worker() isn't called, we drop it here.
 	 */
 	if (dispatch_assert) {
-		if (response != DLM_MASTER_RESP_YES)
-			mlog(ML_ERROR, "invalid response %d\n", response);
-		if (!res) {
-			mlog(ML_ERROR, "bad lockres while trying to assert!\n");
-			BUG();
-		}
 		mlog(0, "%u is the owner of %.*s, cleaning everyone else\n",
 			     dlm->node_num, res->lockname.len, res->lockname.name);
 		spin_lock(&res->spinlock);
-- 
1.9.5.msysgit.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [Ocfs2-devel] [PATCH] ocfs2/dlm: clean up deadcode in dlm_master_request_handler()
  2016-10-31 13:52 [Ocfs2-devel] [PATCH] ocfs2/dlm: clean up deadcode in dlm_master_request_handler() piaojun
@ 2016-11-01  0:22 ` Joseph Qi
  2019-09-04  4:14 ` Andrew Morton
  1 sibling, 0 replies; 3+ messages in thread
From: Joseph Qi @ 2016-11-01  0:22 UTC (permalink / raw)
  To: ocfs2-devel

On 2016/10/31 21:52, piaojun wrote:
> when 'dispatch_assert' is set, 'response' must be DLM_MASTER_RESP_YES,
> and 'res' won't be null, so execution can't reach these two branch.
> 
> Signed-off-by: Jun Piao <piaojun@huawei.com>

Looks good to me.
Reviewed-by: Joseph Qi <joseph.qi@huawei.com>
> ---
>  fs/ocfs2/dlm/dlmmaster.c | 6 ------
>  1 file changed, 6 deletions(-)
> 
> diff --git a/fs/ocfs2/dlm/dlmmaster.c b/fs/ocfs2/dlm/dlmmaster.c
> index 3f828a1..9a72dd8 100644
> --- a/fs/ocfs2/dlm/dlmmaster.c
> +++ b/fs/ocfs2/dlm/dlmmaster.c
> @@ -1644,12 +1644,6 @@ int dlm_master_request_handler(struct o2net_msg *msg, u32 len, void *data,
>  	 * dlm_assert_master_worker() isn't called, we drop it here.
>  	 */
>  	if (dispatch_assert) {
> -		if (response != DLM_MASTER_RESP_YES)
> -			mlog(ML_ERROR, "invalid response %d\n", response);
> -		if (!res) {
> -			mlog(ML_ERROR, "bad lockres while trying to assert!\n");
> -			BUG();
> -		}
>  		mlog(0, "%u is the owner of %.*s, cleaning everyone else\n",
>  			     dlm->node_num, res->lockname.len, res->lockname.name);
>  		spin_lock(&res->spinlock);
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Ocfs2-devel] [PATCH] ocfs2/dlm: clean up deadcode in dlm_master_request_handler()
  2016-10-31 13:52 [Ocfs2-devel] [PATCH] ocfs2/dlm: clean up deadcode in dlm_master_request_handler() piaojun
  2016-11-01  0:22 ` Joseph Qi
@ 2019-09-04  4:14 ` Andrew Morton
  1 sibling, 0 replies; 3+ messages in thread
From: Andrew Morton @ 2019-09-04  4:14 UTC (permalink / raw)
  To: ocfs2-devel

On Mon, 31 Oct 2016 21:52:17 +0800 piaojun <piaojun@huawei.com> wrote:

> when 'dispatch_assert' is set, 'response' must be DLM_MASTER_RESP_YES,
> and 'res' won't be null, so execution can't reach these two branch.
> 
> ...
>
> --- a/fs/ocfs2/dlm/dlmmaster.c
> +++ b/fs/ocfs2/dlm/dlmmaster.c
> @@ -1644,12 +1644,6 @@ int dlm_master_request_handler(struct o2net_msg *msg, u32 len, void *data,
>  	 * dlm_assert_master_worker() isn't called, we drop it here.
>  	 */
>  	if (dispatch_assert) {
> -		if (response != DLM_MASTER_RESP_YES)
> -			mlog(ML_ERROR, "invalid response %d\n", response);
> -		if (!res) {
> -			mlog(ML_ERROR, "bad lockres while trying to assert!\n");
> -			BUG();
> -		}
>  		mlog(0, "%u is the owner of %.*s, cleaning everyone else\n",
>  			     dlm->node_num, res->lockname.len, res->lockname.name);
>  		spin_lock(&res->spinlock);

This code is quite different in Linus's current tree.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-09-04  4:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-31 13:52 [Ocfs2-devel] [PATCH] ocfs2/dlm: clean up deadcode in dlm_master_request_handler() piaojun
2016-11-01  0:22 ` Joseph Qi
2019-09-04  4:14 ` Andrew Morton

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.