Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1161141AbWI2DJU (ORCPT ); Thu, 28 Sep 2006 23:09:20 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1161155AbWI2DJK (ORCPT ); Thu, 28 Sep 2006 23:09:10 -0400 Received: from ns1.suse.de ([195.135.220.2]:40081 "EHLO mx1.suse.de") by vger.kernel.org with ESMTP id S1161141AbWI2DIu (ORCPT ); Thu, 28 Sep 2006 23:08:50 -0400 From: NeilBrown To: Andrew Morton Date: Fri, 29 Sep 2006 13:08:45 +1000 Message-Id: <1060929030845.24038@suse.de> X-face: [Gw_3E*Gng}4rRrKRYotwlE?.2|**#s9D Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1221 Lines: 41 If nlm_lookup_host finds what it is looking for it exits with an extra reference on the matching 'nsm' structure. So don't actually count the reference until we are (fairly) sure it is going to be used. Signed-off-by: Neil Brown ### Diffstat output ./fs/lockd/host.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff .prev/fs/lockd/host.c ./fs/lockd/host.c --- .prev/fs/lockd/host.c 2006-09-29 11:44:21.000000000 +1000 +++ ./fs/lockd/host.c 2006-09-29 11:55:15.000000000 +1000 @@ -103,8 +103,8 @@ nlm_lookup_host(int server, const struct continue; /* See if we have an NSM handle for this client */ - if (!nsm && (nsm = host->h_nsmhandle) != 0) - atomic_inc(&nsm->sm_count); + if (!nsm) + nsm = host->h_nsmhandle; if (host->h_proto != proto) continue; @@ -120,6 +120,8 @@ nlm_lookup_host(int server, const struct nlm_get_host(host); goto out; } + if (nsm) + atomic_inc(&nsm->sm_count); host = NULL; - 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/