Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753047AbbFKJuK (ORCPT ); Thu, 11 Jun 2015 05:50:10 -0400 Received: from smtp2.provo.novell.com ([137.65.250.81]:58327 "EHLO smtp2.provo.novell.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752221AbbFKJt4 (ORCPT ); Thu, 11 Jun 2015 05:49:56 -0400 Message-ID: <55795930.1030608@suse.com> Date: Thu, 11 Jun 2015 17:47:28 +0800 From: Guoqing Jiang User-Agent: Thunderbird 2.0.0.24 (X11/20100302) MIME-Version: 1.0 To: David Teigland CC: Bob Peterson , ccaulfie@redhat.com, cluster-devel@redhat.com, linux-kernel@vger.kernel.org Subject: Re: [Cluster-devel] [PATCH] dlm: remove unnecessary error check References: <1433843172-8953-1-git-send-email-gqjiang@suse.com> <1545280635.13245793.1433851749238.JavaMail.zimbra@redhat.com> <5577A36D.5010908@suse.com> <70321158.13952725.1433904643714.JavaMail.zimbra@redhat.com> <5577AAB4.20700@suse.com> <20150610152438.GB333@redhat.com> In-Reply-To: <20150610152438.GB333@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1749 Lines: 64 Hi David, David Teigland wrote: > On Wed, Jun 10, 2015 at 11:10:44AM +0800, Guoqing Jiang wrote: > >> The remove_from_waiters could only be invoked after failed to >> create_message, right? >> Since send_message always returns 0, this patch doesn't touch anything >> about the failure >> path, and it also doesn't change the original semantic. >> > > I'm not inclined to take any patches unless there's a problem identified. > > . > Do you consider take the following clean up? If yes, I will send a formal patch, otherwise pls ignore it. diff --git a/fs/dlm/lock.c b/fs/dlm/lock.c index 35502d4..7c822f7 100644 --- a/fs/dlm/lock.c +++ b/fs/dlm/lock.c @@ -3747,30 +3747,7 @@ static int send_bast(struct dlm_rsb *r, struct dlm_lkb *lkb, int mode) static int send_lookup(struct dlm_rsb *r, struct dlm_lkb *lkb) { - struct dlm_message *ms; - struct dlm_mhandle *mh; - int to_nodeid, error; - - to_nodeid = dlm_dir_nodeid(r); - - error = add_to_waiters(lkb, DLM_MSG_LOOKUP, to_nodeid); - if (error) - return error; - - error = create_message(r, NULL, to_nodeid, DLM_MSG_LOOKUP, &ms, &mh); - if (error) - goto fail; - - send_args(r, lkb, ms); - - error = send_message(mh, ms); - if (error) - goto fail; - return 0; - - fail: - remove_from_waiters(lkb, DLM_MSG_LOOKUP_REPLY); - return error; + return send_common(r, lkb, DLM_MSG_LOOKUP); } Thanks, Guoqing -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/