From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932622AbbCELuq (ORCPT ); Thu, 5 Mar 2015 06:50:46 -0500 Received: from mail-qa0-f47.google.com ([209.85.216.47]:49928 "EHLO mail-qa0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752355AbbCELuo (ORCPT ); Thu, 5 Mar 2015 06:50:44 -0500 Date: Thu, 5 Mar 2015 06:50:40 -0500 From: Jeff Layton To: Daniel Wagner Cc: , , , Subject: Re: [PATCH] locks: fix fasync_struct memory leak in lease upgrade/downgrade handling Message-ID: <20150305065040.60635dfa@tlielax.poochiereds.net> In-Reply-To: <54F7FE45.5000100@bmw-carit.de> References: <1425513974-27153-1-git-send-email-jeff.layton@primarydata.com> <54F7FE45.5000100@bmw-carit.de> X-Mailer: Claws Mail 3.11.1 (GTK+ 2.24.26; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 5 Mar 2015 07:57:09 +0100 Daniel Wagner wrote: > Hi Jeff, > > On 03/05/2015 01:06 AM, Jeff Layton wrote: > > Commit 8634b51f6ca2 (locks: convert lease handling to file_lock_context) > > introduced a regression in the handling of lease upgrade/downgrades. > > > > In the event that we already have a lease on a file and are going to > > either upgrade or downgrade it, we skip doing any list insertion or > > deletion and skip to re-calling lm_setup on the existing lease. > > > > As of commit 8634b51f6ca2 however, we end up calling lm_setup on the > > lease that was passed in, instead of on the existing lease. This causes > > us to leak the fasync_struct that was allocated in the event that there > > was not already an existing one (as it always appeared that there > > wasn't one). > > > > Fixes: 8634b51f6ca2 (locks: convert lease handling to file_lock_context) > > Yes, that fixes the problem. Thanks! > > > Reported-by: Daniel Wagner > > Signed-off-by: Jeff Layton > > Tested-by: Daniel Wagner > > > cheers, > daniel Thanks for testing it! I'll let it soak in linux-next for a day or so and then send a pull request to Linus. Cheers! -- Jeff Layton