From patchwork Mon Apr 5 21:17:39 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Shilovsky X-Patchwork-Id: 90686 Received: from lists.samba.org (fn.samba.org [216.83.154.106]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o35LHlPJ022772 for ; Mon, 5 Apr 2010 21:18:23 GMT Received: from fn.samba.org (localhost [127.0.0.1]) by lists.samba.org (Postfix) with ESMTP id 2ED11AD213; Mon, 5 Apr 2010 15:17:49 -0600 (MDT) X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on fn.samba.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=3.8 tests=AWL, BAYES_00 autolearn=ham version=3.2.5 X-Original-To: linux-cifs-client@lists.samba.org Delivered-To: linux-cifs-client@lists.samba.org Received: from mail.etersoft.ru (mail.etersoft.ru [87.249.47.46]) by lists.samba.org (Postfix) with ESMTP id 8C375AD093 for ; Mon, 5 Apr 2010 15:17:42 -0600 (MDT) From: Pavel Shilovsky To: linux-cifs-client@lists.samba.org Date: Tue, 6 Apr 2010 01:17:39 +0400 User-Agent: KMail/1.13.1 (Linux/2.6.32.9-70.fc12.x86_64; KDE/4.4.1; x86_64; ; ) References: <201004060114.36019.piastry@etersoft.ru> In-Reply-To: <201004060114.36019.piastry@etersoft.ru> MIME-Version: 1.0 Message-Id: <201004060117.39791.piastry@etersoft.ru> Subject: Re: [linux-cifs-client] [PATCH] Fix losing locks during fork X-BeenThere: linux-cifs-client@lists.samba.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: The Linux CIFS VFS client List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-cifs-client-bounces@lists.samba.org Errors-To: linux-cifs-client-bounces@lists.samba.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Mon, 05 Apr 2010 21:18:23 +0000 (UTC) diff --git a/fs/cifs/file.c b/fs/cifs/file.c index c34b7f8..7185cd3 100644 --- a/fs/cifs/file.c +++ b/fs/cifs/file.c @@ -898,9 +898,10 @@ int cifs_lock(struct file *file, int cmd, struct file_lock *pfLock) 1, 0, li->type, false); if (stored_rc) rc = stored_rc; - - list_del(&li->llist); - kfree(li); + else { + list_del(&li->llist); + kfree(li); + } } } mutex_unlock(&fid->lock_mutex);